diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bd53652..05e57de 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,8 +2,8 @@ name: Build and Test on: push env: - RUST_VERSION: 1.70.0 - NIGHTLY_VERSION: nightly-2023-05-31 + RUST_VERSION: 1.76.0 + NIGHTLY_VERSION: nightly-2024-02-04 CARGO_VET_VERSION: 0.7.0 CARGO_VET_REPO: https://github.com/mozilla/cargo-vet diff --git a/crates/semaphore-depth-macros/src/lib.rs b/crates/semaphore-depth-macros/src/lib.rs index 377085d..fa2d9e3 100644 --- a/crates/semaphore-depth-macros/src/lib.rs +++ b/crates/semaphore-depth-macros/src/lib.rs @@ -101,8 +101,8 @@ impl VisitMut for IdentReplacer { } } syn::Expr::Macro(mcr) => { - let Ok(mut args) = mcr.mac.parse_body::() else { - return; + let Ok(mut args) = mcr.mac.parse_body::() else { + return; }; for arg in &mut args.args { self.visit_expr_mut(arg); diff --git a/src/lazy_merkle_tree.rs b/src/lazy_merkle_tree.rs index 27b669f..98c4a74 100644 --- a/src/lazy_merkle_tree.rs +++ b/src/lazy_merkle_tree.rs @@ -1149,7 +1149,7 @@ impl MmapMutWrapper { }; file.set_len(file_size).expect("cannot set file size"); - if file.write_all(&buf).is_err() { + if file.write_all(buf).is_err() { return Err(DenseMMapError::FileCannotWriteBytes); } diff --git a/src/lib.rs b/src/lib.rs index 00a2248..3eeca67 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -145,8 +145,11 @@ mod test { #[cfg(feature = "bench")] pub mod bench { use crate::{ - hash_to_field, identity::Identity, poseidon_tree::LazyPoseidonTree, - protocol::{generate_proof, generate_witness}, Field, + hash_to_field, + identity::Identity, + poseidon_tree::LazyPoseidonTree, + protocol::{generate_proof, generate_witness}, + Field, }; use criterion::Criterion; use semaphore_depth_config::get_supported_depths; @@ -182,18 +185,18 @@ pub mod bench { fn bench_witness(criterion: &mut Criterion, depth: usize) { let leaf = Field::from(0); - + // Create tree let mut hello = *b"hello"; let id = Identity::from_secret(&mut hello, None); let mut tree = LazyPoseidonTree::new(depth, leaf).derived(); tree = tree.update(0, &id.commitment()); let merkle_proof = tree.proof(0); - + // change signal and external_nullifier here let signal_hash = hash_to_field(b"xxx"); let external_nullifier_hash = hash_to_field(b"appId"); - + criterion.bench_function(&format!("witness_{depth}"), move |b| { b.iter(|| { generate_witness(&id, &merkle_proof, external_nullifier_hash, signal_hash).unwrap();