File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ // Use a Hashmap for the Entry API in order to prevent hashing twice.
2
+ // This can maybe be replaced with a HashSet once `get_or_insert_with`
3
+ // or a proper Entry API for Hashset is stable and meets this msrv
4
+ #![ allow( clippy:: zero_sized_map_values) ]
5
+
1
6
use std:: collections:: HashMap ;
2
7
use std:: collections:: hash_map:: Entry ;
3
8
use std:: hash:: Hash ;
@@ -11,9 +16,7 @@ use std::iter::FusedIterator;
11
16
#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
12
17
pub struct UniqueBy < I : Iterator , V , F > {
13
18
iter : I ,
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
19
+ // see comment for `allow(clippy::zero_sized_map_values)` for reasoning
17
20
used : HashMap < V , ( ) > ,
18
21
f : F ,
19
22
}
You can’t perform that action at this time.
0 commit comments