diff --git a/lib.rs b/lib.rs index cf0363e..0db0e39 100644 --- a/lib.rs +++ b/lib.rs @@ -91,13 +91,6 @@ pub trait VecLike: /// Append an element to the vector. fn push(&mut self, value: T); - /// Removes consecutive repeated elements. - fn dedup(&mut self) where T: PartialEq; - /// Removes consecutive repeated elements with a given equality relation. - fn dedup_by(&mut self, same_bucket: F) where F: FnMut(&mut T, &mut T) -> bool; - /// Removes consecutive elements that resolve to the same key. - fn dedup_by_key(&mut self, key: F) where F: FnMut(&mut T) -> K, - K: PartialEq; } impl VecLike for Vec { @@ -105,23 +98,6 @@ impl VecLike for Vec { fn push(&mut self, value: T) { Vec::push(self, value); } - - fn dedup(&mut self) where T: PartialEq { - Vec::dedup(self); - } - - fn dedup_by(&mut self, same_bucket: F) - where F: FnMut(&mut T, &mut T) -> bool - { - Vec::dedup_by(self, same_bucket); - } - - fn dedup_by_key(&mut self, key: F) - where F: FnMut(&mut T) -> K, - K: PartialEq - { - Vec::dedup_by_key(self, key); - } } /// Trait to be implemented by a collection that can be extended from a slice @@ -926,23 +902,6 @@ impl VecLike for SmallVec { fn push(&mut self, value: A::Item) { SmallVec::push(self, value); } - - fn dedup(&mut self) where A::Item: PartialEq { - SmallVec::dedup(self); - } - - fn dedup_by(&mut self, same_bucket: F) - where F: FnMut(&mut A::Item, &mut A::Item) -> bool - { - SmallVec::dedup_by(self, same_bucket); - } - - fn dedup_by_key(&mut self, key: F) - where F: FnMut(&mut A::Item) -> K, - K: PartialEq - { - SmallVec::dedup_by_key(self, key); - } } impl FromIterator for SmallVec {