File tree 1 file changed +2
-19
lines changed
1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -1821,7 +1821,8 @@ impl<T: PartialOrd> PartialOrd for [T] {
1821
1821
// intermediate trait for specialization of slice's PartialEq
1822
1822
trait SlicePartialEq < B > {
1823
1823
fn equal ( & self , other : & [ B ] ) -> bool ;
1824
- fn not_equal ( & self , other : & [ B ] ) -> bool ;
1824
+
1825
+ fn not_equal ( & self , other : & [ B ] ) -> bool { !self . equal ( other) }
1825
1826
}
1826
1827
1827
1828
// Generic slice equality
@@ -1841,20 +1842,6 @@ impl<A, B> SlicePartialEq<B> for [A]
1841
1842
1842
1843
true
1843
1844
}
1844
-
1845
- default fn not_equal ( & self , other : & [ B ] ) -> bool {
1846
- if self . len ( ) != other. len ( ) {
1847
- return true ;
1848
- }
1849
-
1850
- for i in 0 ..self . len ( ) {
1851
- if self [ i] . ne ( & other[ i] ) {
1852
- return true ;
1853
- }
1854
- }
1855
-
1856
- false
1857
- }
1858
1845
}
1859
1846
1860
1847
// Use memcmp for bytewise equality when the types allow
@@ -1874,10 +1861,6 @@ impl<A> SlicePartialEq<A> for [A]
1874
1861
other. as_ptr ( ) as * const u8 , size) == 0
1875
1862
}
1876
1863
}
1877
-
1878
- fn not_equal ( & self , other : & [ A ] ) -> bool {
1879
- !self . equal ( other)
1880
- }
1881
1864
}
1882
1865
1883
1866
#[ doc( hidden) ]
You can’t perform that action at this time.
0 commit comments