about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-10-01 18:17:49 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-10-01 18:17:49 +0200
commit8a959ad4472ad472668696dcaf9dbb7b41e93eec (patch)
tree34972c9a44a588a28d05149d7f137cab834e23ee
parent24202c6431a29d18f58c6d7302d6a9095e218395 (diff)
downloadrust-8a959ad4472ad472668696dcaf9dbb7b41e93eec.tar.gz
rust-8a959ad4472ad472668696dcaf9dbb7b41e93eec.zip
Remove one level of indirection for slice-based PartialEq impls
Using the comparison operators already refs the operands, so doing it
ourselves as well just adds an unnecessary level of indirection.
-rw-r--r--src/libcore/cmp_macros.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/cmp_macros.rs b/src/libcore/cmp_macros.rs
index 95dab3d165a..3863f63265b 100644
--- a/src/libcore/cmp_macros.rs
+++ b/src/libcore/cmp_macros.rs
@@ -21,9 +21,9 @@ macro_rules! __impl_slice_eq1 {
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
             #[inline]
-            fn eq(&self, other: &$Rhs) -> bool { &self[..] == &other[..] }
+            fn eq(&self, other: &$Rhs) -> bool { self[..] == other[..] }
             #[inline]
-            fn ne(&self, other: &$Rhs) -> bool { &self[..] != &other[..] }
+            fn ne(&self, other: &$Rhs) -> bool { self[..] != other[..] }
         }
     }
 }
@@ -39,9 +39,9 @@ macro_rules! __impl_slice_eq2 {
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<'a, 'b, A: $Bound, B> PartialEq<$Lhs> for $Rhs where B: PartialEq<A> {
             #[inline]
-            fn eq(&self, other: &$Lhs) -> bool { &self[..] == &other[..] }
+            fn eq(&self, other: &$Lhs) -> bool { self[..] == other[..] }
             #[inline]
-            fn ne(&self, other: &$Lhs) -> bool { &self[..] != &other[..] }
+            fn ne(&self, other: &$Lhs) -> bool { self[..] != other[..] }
         }
     }
 }