File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,14 @@ impl Proof {
62
62
merkle_tree_depth : u16 ,
63
63
) -> Result < SemaphoreProof > {
64
64
// 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 ) {
66
66
bail ! ( format!(
67
67
"The tree depth must be a number between {} and {}" ,
68
68
MIN_TREE_DEPTH , MAX_TREE_DEPTH
69
69
) ) ;
70
70
}
71
71
72
- let merkle_proof = group. merkle_proof ( & to_element ( identity. commitment ( ) . clone ( ) ) ) ;
72
+ let merkle_proof = group. merkle_proof ( & to_element ( * identity. commitment ( ) ) ) ;
73
73
let merkle_proof_length = merkle_proof. siblings . len ( ) ;
74
74
75
75
// The index must be converted to a list of indices, 1 for each tree level.
@@ -80,7 +80,7 @@ impl Proof {
80
80
merkle_proof_indices. push ( ( merkle_proof. index >> i) & 1 ) ;
81
81
82
82
if let Some ( sibling) = merkle_proof. siblings . get ( i as usize ) {
83
- merkle_proof_siblings. push ( sibling. clone ( ) ) ;
83
+ merkle_proof_siblings. push ( * sibling) ;
84
84
} else {
85
85
merkle_proof_siblings. push ( EMPTY_ELEMENT ) ;
86
86
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub fn to_big_uint(str: &String) -> BigUint {
22
22
let bytes = str. as_bytes ( ) ;
23
23
assert ! ( bytes. len( ) <= 32 , "BigUint too large: exceeds 32 bytes" ) ;
24
24
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) ;
26
26
BigUint :: from_bytes_be ( & fixed_bytes)
27
27
}
28
28
You can’t perform that action at this time.
0 commit comments