Skip to content

Commit 7643c4c

Browse files
committed
Auto merge of rust-lang#28792 - dotdash:cmp_indirection, r=alexcrichton
Using the comparison operators already refs the operands, so doing it ourselves as well just adds an unnecessary level of indirection.
2 parents 0ffc682 + 8a959ad commit 7643c4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/cmp_macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ macro_rules! __impl_slice_eq1 {
2121
#[stable(feature = "rust1", since = "1.0.0")]
2222
impl<'a, 'b, A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
2323
#[inline]
24-
fn eq(&self, other: &$Rhs) -> bool { &self[..] == &other[..] }
24+
fn eq(&self, other: &$Rhs) -> bool { self[..] == other[..] }
2525
#[inline]
26-
fn ne(&self, other: &$Rhs) -> bool { &self[..] != &other[..] }
26+
fn ne(&self, other: &$Rhs) -> bool { self[..] != other[..] }
2727
}
2828
}
2929
}
@@ -39,9 +39,9 @@ macro_rules! __impl_slice_eq2 {
3939
#[stable(feature = "rust1", since = "1.0.0")]
4040
impl<'a, 'b, A: $Bound, B> PartialEq<$Lhs> for $Rhs where B: PartialEq<A> {
4141
#[inline]
42-
fn eq(&self, other: &$Lhs) -> bool { &self[..] == &other[..] }
42+
fn eq(&self, other: &$Lhs) -> bool { self[..] == other[..] }
4343
#[inline]
44-
fn ne(&self, other: &$Lhs) -> bool { &self[..] != &other[..] }
44+
fn ne(&self, other: &$Lhs) -> bool { self[..] != other[..] }
4545
}
4646
}
4747
}

0 commit comments

Comments
 (0)