Skip to content

Commit 3e67e98

Browse files
committed
chore: fixing lint
1 parent 59c7739 commit 3e67e98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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)