Skip to content

Commit

Permalink
Clean up hashmap merge
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Jul 13, 2024
1 parent 693d1e0 commit 9b077c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/passphrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ mod test {
})
.collect::<Vec<HashMap<String, usize>>>()
.iter()
.fold(HashMap::new(), |mut acc, h| {
for (k, v) in h {
.fold(HashMap::new(), |acc, h| {
h.iter().fold(acc, |mut acc, (k, v)| {
*acc.entry(k.to_owned()).or_insert(0) += v;
}
acc
acc
})
});

assert_eq!(histogram.values().sum::<usize>(), N, "missing samples");
Expand Down

0 comments on commit 9b077c1

Please sign in to comment.