Skip to content

Commit 9dd1ad4

Browse files
authored
Merge branch 'master' into clippy-lints
2 parents 34ece9e + 5c11e00 commit 9dd1ad4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/unique_impl.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
use std::collections::HashMap;
3-
use std::collections::hash_map::{Entry};
2+
use std::collections::hash_map::Entry;
43
use std::hash::Hash;
54
use std::fmt;
65
use std::iter::FusedIterator;
@@ -12,7 +11,9 @@ use std::iter::FusedIterator;
1211
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
1312
pub struct UniqueBy<I: Iterator, V, F> {
1413
iter: I,
15-
// Use a hashmap for the entry API
14+
// Use a Hashmap for the Entry API in order to prevent hashing twice.
15+
// This can maybe be replaced with a HashSet once `get_or_insert_with`
16+
// or a proper Entry API for Hashset is stable and meets this msrv
1617
used: HashMap<V, ()>,
1718
f: F,
1819
}

0 commit comments

Comments
 (0)