Skip to content

Commit 36c2c21

Browse files
committed
chore: fixing lint
1 parent 59c7739 commit 36c2c21

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ tokio = { version = "1", features = ["full"] }
1919
ark-ec = { version = "=0.5.0", default-features = false }
2020
ark-ed-on-bn254 = { version = "=0.5.0", default-features = false }
2121
ark-ff = { version = "=0.5.0", default-features = false }
22-
# ark-bn254 = "0.5.0"
2322

2423
# zk-kit
2524
zk-kit-lean-imt = { git = "https://github.com/brech1/zk-kit.rust", package = "zk-kit-lean-imt", branch = "feat/generic-tree" }

src/proof.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ impl Proof {
6262
merkle_tree_depth: u16,
6363
) -> Result<SemaphoreProof> {
6464
// check tree depth
65-
if merkle_tree_depth < MIN_TREE_DEPTH || merkle_tree_depth > MAX_TREE_DEPTH {
65+
if !(MIN_TREE_DEPTH..=MAX_TREE_DEPTH).contains(&merkle_tree_depth) {
6666
bail!(format!(
6767
"The tree depth must be a number between {} and {}",
6868
MIN_TREE_DEPTH, MAX_TREE_DEPTH
6969
));
7070
}
7171

72-
let merkle_proof = group.merkle_proof(&to_element(identity.commitment().clone()));
72+
let merkle_proof = group.merkle_proof(&to_element(*identity.commitment()));
7373
let merkle_proof_length = merkle_proof.siblings.len();
7474

7575
// The index must be converted to a list of indices, 1 for each tree level.
@@ -80,7 +80,7 @@ impl Proof {
8080
merkle_proof_indices.push((merkle_proof.index >> i) & 1);
8181

8282
if let Some(sibling) = merkle_proof.siblings.get(i as usize) {
83-
merkle_proof_siblings.push(sibling.clone());
83+
merkle_proof_siblings.push(*sibling);
8484
} else {
8585
merkle_proof_siblings.push(EMPTY_ELEMENT);
8686
}

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn to_big_uint(str: &String) -> BigUint {
2222
let bytes = str.as_bytes();
2323
assert!(bytes.len() <= 32, "BigUint too large: exceeds 32 bytes");
2424
let mut fixed_bytes = [0u8; 32];
25-
fixed_bytes[0..bytes.len()].copy_from_slice(&bytes);
25+
fixed_bytes[0..bytes.len()].copy_from_slice(bytes);
2626
BigUint::from_bytes_be(&fixed_bytes)
2727
}
2828

0 commit comments

Comments
 (0)