Skip to content

Commit

Permalink
Merge branch 'master' into clippy-lints
Browse files Browse the repository at this point in the history
  • Loading branch information
phimuemue committed Jun 9, 2022
2 parents 34ece9e + 5c11e00 commit 9dd1ad4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/unique_impl.rs
@@ -1,6 +1,5 @@

use std::collections::HashMap;
use std::collections::hash_map::{Entry};
use std::collections::hash_map::Entry;
use std::hash::Hash;
use std::fmt;
use std::iter::FusedIterator;
Expand All @@ -12,7 +11,9 @@ use std::iter::FusedIterator;
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct UniqueBy<I: Iterator, V, F> {
iter: I,
// Use a hashmap for the entry API
// Use a Hashmap for the Entry API in order to prevent hashing twice.
// This can maybe be replaced with a HashSet once `get_or_insert_with`
// or a proper Entry API for Hashset is stable and meets this msrv
used: HashMap<V, ()>,
f: F,
}
Expand Down

0 comments on commit 9dd1ad4

Please sign in to comment.