diff --git a/src/unique_impl.rs b/src/unique_impl.rs index a0b46b785..9b103a075 100644 --- a/src/unique_impl.rs +++ b/src/unique_impl.rs @@ -165,14 +165,18 @@ where /// See [`.unique()`](crate::Itertools::unique) for more information. #[derive(Clone)] #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] -pub struct Unique { +pub struct Unique +where + I: Iterator, + I::Item: Eq + Hash + Clone, +{ iter: UniqueBy, } impl fmt::Debug for Unique where I: Iterator + fmt::Debug, - I::Item: Hash + Eq + fmt::Debug, + I::Item: Hash + Eq + fmt::Debug + Clone, { debug_fmt_fields!(Unique, iter); } @@ -180,7 +184,7 @@ where pub fn unique(iter: I) -> Unique where I: Iterator, - I::Item: Eq + Hash, + I::Item: Eq + Hash + Clone, { Unique { iter: UniqueBy {