diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index baa41aa7af5..b22bdb43414 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -1821,7 +1821,8 @@ impl PartialOrd for [T] { // intermediate trait for specialization of slice's PartialEq trait SlicePartialEq { fn equal(&self, other: &[B]) -> bool; - fn not_equal(&self, other: &[B]) -> bool; + + fn not_equal(&self, other: &[B]) -> bool { !self.equal(other) } } // Generic slice equality @@ -1841,20 +1842,6 @@ impl SlicePartialEq for [A] true } - - default fn not_equal(&self, other: &[B]) -> bool { - if self.len() != other.len() { - return true; - } - - for i in 0..self.len() { - if self[i].ne(&other[i]) { - return true; - } - } - - false - } } // Use memcmp for bytewise equality when the types allow @@ -1874,10 +1861,6 @@ impl SlicePartialEq for [A] other.as_ptr() as *const u8, size) == 0 } } - - fn not_equal(&self, other: &[A]) -> bool { - !self.equal(other) - } } #[doc(hidden)]