]> git.lizzy.rs Git - rust.git/commitdiff
Change PartialEq impls in collections::string to slice notation
authorGleb Kozyrev <gleb@gkoz.com>
Thu, 2 Apr 2015 15:50:09 +0000 (18:50 +0300)
committerGleb Kozyrev <gleb@gkoz.com>
Thu, 2 Apr 2015 15:52:53 +0000 (18:52 +0300)
src/libcollections/string.rs

index 7a7725320914f6fdba19cb1443d0d1e9c2da753b..bce314b6e04a90ffc1460b65935623b18bebe603 100644 (file)
@@ -796,9 +796,9 @@ fn is_prefix_of(self, haystack: &'a str) -> bool {
 #[stable(feature = "rust1", since = "1.0.0")]
 impl PartialEq for String {
     #[inline]
-    fn eq(&self, other: &String) -> bool { PartialEq::eq(&**self, &**other) }
+    fn eq(&self, other: &String) -> bool { PartialEq::eq(&self[..], &other[..]) }
     #[inline]
-    fn ne(&self, other: &String) -> bool { PartialEq::ne(&**self, &**other) }
+    fn ne(&self, other: &String) -> bool { PartialEq::ne(&self[..], &other[..]) }
 }
 
 macro_rules! impl_eq {
@@ -806,17 +806,17 @@ macro_rules! impl_eq {
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a> PartialEq<$rhs> for $lhs {
             #[inline]
-            fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&**self, &**other) }
+            fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
             #[inline]
-            fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&**self, &**other) }
+            fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
         }
 
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a> PartialEq<$lhs> for $rhs {
             #[inline]
-            fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&**self, &**other) }
+            fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
             #[inline]
-            fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&**self, &**other) }
+            fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
         }
 
     }
@@ -828,17 +828,17 @@ fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&**self, &**other) }
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str> {
     #[inline]
-    fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&**self, &**other) }
+    fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&self[..], &other[..]) }
     #[inline]
-    fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&**self, &**other) }
+    fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&self[..], &other[..]) }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str {
     #[inline]
-    fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&**self, &**other) }
+    fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&self[..], &other[..]) }
     #[inline]
-    fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&**self, &**other) }
+    fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&self[..], &other[..]) }
 }
 
 #[unstable(feature = "collections", reason = "waiting on Str stabilization")]