diff options
| author | Justin LeFebvre <jstnlefebvre@gmail.com> | 2016-09-06 01:04:07 -0400 |
|---|---|---|
| committer | Justin LeFebvre <jstnlefebvre@gmail.com> | 2016-09-06 20:39:58 -0400 |
| commit | a77b55d58f9b173b1e4fb96bb6935fadbfda3240 (patch) | |
| tree | 71a2899ae7c4abc87cfdf96dc0e562f37c5c5490 | |
| parent | 923bac45964940c56ab1075fb7980896de1eb620 (diff) | |
| download | rust-a77b55d58f9b173b1e4fb96bb6935fadbfda3240.tar.gz rust-a77b55d58f9b173b1e4fb96bb6935fadbfda3240.zip | |
remove the extraneous not_equal implementation for slices.
| -rw-r--r-- | src/libcore/slice.rs | 21 |
1 files changed, 2 insertions, 19 deletions
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<T: PartialOrd> PartialOrd for [T] { // intermediate trait for specialization of slice's PartialEq trait SlicePartialEq<B> { 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<A, B> SlicePartialEq<B> 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<A> SlicePartialEq<A> for [A] other.as_ptr() as *const u8, size) == 0 } } - - fn not_equal(&self, other: &[A]) -> bool { - !self.equal(other) - } } #[doc(hidden)] |
