Skip to content

Commit

Permalink
refactor(storage-proofs): use iterator instead of for loop
Browse files Browse the repository at this point in the history
Found with clippy; we are using a for loop but the current lint level
requires us to use an iterator.

As suggested; use an iterator instead of the for loop.
  • Loading branch information
tcharding committed Jun 16, 2020
1 parent 014c16c commit 3592d8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage-proofs/core/src/crypto/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ mod tests {
let hashed = pedersen_md_no_padding(&flat);

let mut hasher = Hasher::new(&x[0]).unwrap();
for k in 1..5 {
hasher.update(&x[k]).unwrap();
for val in x.iter().skip(1).take(4) {
hasher.update(&val).unwrap();
}

let hasher_final = hasher.finalize().unwrap();
Expand Down

0 comments on commit 3592d8c

Please sign in to comment.