diff --git a/src/libcollections/ring_buf.rs b/src/libcollections/ring_buf.rs index aa0e33248fcc1..27209f98cdb9c 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -1294,9 +1294,6 @@ impl PartialEq for RingBuf { self.len() == other.len() && self.iter().zip(other.iter()).all(|(a, b)| a.eq(b)) } - fn ne(&self, other: &RingBuf) -> bool { - !self.eq(other) - } } impl Eq for RingBuf {} diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 1babde6066d06..12e1a3dbad91f 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -60,7 +60,6 @@ use vec::Vec; /// months.clear(); /// assert!(months.is_empty()); /// ``` -#[deriving(PartialEq, Eq)] pub struct VecMap { v: Vec>, } @@ -489,6 +488,14 @@ impl VecMap { } } +impl PartialEq for VecMap { + fn eq(&self, other: &VecMap) -> bool { + iter::order::eq(self.iter(), other.iter()) + } +} + +impl Eq for VecMap {} + impl PartialOrd for VecMap { #[inline] fn partial_cmp(&self, other: &VecMap) -> Option { @@ -952,6 +959,10 @@ mod test_map { assert!(a != b); assert!(b.insert(5, 19).is_none()); assert!(a == b); + + a = VecMap::new(); + b = VecMap::with_capacity(1); + assert!(a == b); } #[test]