File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 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+
16use std:: collections:: HashMap ;
27use std:: collections:: hash_map:: Entry ;
38use std:: hash:: Hash ;
@@ -11,9 +16,7 @@ use std::iter::FusedIterator;
1116#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
1217pub struct UniqueBy < I : Iterator , V , F > {
1318 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
1720 used : HashMap < V , ( ) > ,
1821 f : F ,
1922}
You can’t perform that action at this time.
0 commit comments