Skip to content

Commit

Permalink
refactor(storage-proofs): use dedicated copied method
Browse files Browse the repository at this point in the history
Clippy emits two errors of type:

        error: You are using an explicit closure for copying elements

Along with the suggestion to us `copied` instead. Do as clippy
suggests.
  • Loading branch information
tcharding committed Jun 16, 2020
1 parent 2509145 commit 2dd0448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage-proofs/core/src/hasher/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ mod tests {
PoseidonDomain(Fr::one().into_repr()),
];

let t = MerkleTree::<PoseidonHasher, typenum::U2>::new(values.iter().map(|x| *x)).unwrap();
let t = MerkleTree::<PoseidonHasher, typenum::U2>::new(values.iter().copied()).unwrap();

let p = t.gen_proof(0).unwrap(); // create a proof for the first value =k Fr::one()

Expand Down Expand Up @@ -453,7 +453,7 @@ mod tests {
PoseidonDomain(Fr::one().into_repr()),
];

let t = MerkleTree::<PoseidonHasher, typenum::U2>::new(leaves.iter().map(|x| *x)).unwrap();
let t = MerkleTree::<PoseidonHasher, typenum::U2>::new(leaves.iter().copied()).unwrap();

assert_eq!(t.leafs(), 4);

Expand Down

0 comments on commit 2dd0448

Please sign in to comment.