Skip to content

Commit 63c01ce

Browse files
committed
Change PartialEq impls in collections::string to slice notation
1 parent 3e8a773 commit 63c01ce

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/libcollections/string.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -796,27 +796,27 @@ impl<'a, 'b> Pattern<'a> for &'b String {
796796
#[stable(feature = "rust1", since = "1.0.0")]
797797
impl PartialEq for String {
798798
#[inline]
799-
fn eq(&self, other: &String) -> bool { PartialEq::eq(&**self, &**other) }
799+
fn eq(&self, other: &String) -> bool { PartialEq::eq(&self[..], &other[..]) }
800800
#[inline]
801-
fn ne(&self, other: &String) -> bool { PartialEq::ne(&**self, &**other) }
801+
fn ne(&self, other: &String) -> bool { PartialEq::ne(&self[..], &other[..]) }
802802
}
803803

804804
macro_rules! impl_eq {
805805
($lhs:ty, $rhs: ty) => {
806806
#[stable(feature = "rust1", since = "1.0.0")]
807807
impl<'a> PartialEq<$rhs> for $lhs {
808808
#[inline]
809-
fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&**self, &**other) }
809+
fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
810810
#[inline]
811-
fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&**self, &**other) }
811+
fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
812812
}
813813

814814
#[stable(feature = "rust1", since = "1.0.0")]
815815
impl<'a> PartialEq<$lhs> for $rhs {
816816
#[inline]
817-
fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&**self, &**other) }
817+
fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
818818
#[inline]
819-
fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&**self, &**other) }
819+
fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
820820
}
821821

822822
}
@@ -828,17 +828,17 @@ impl_eq! { Cow<'a, str>, String }
828828
#[stable(feature = "rust1", since = "1.0.0")]
829829
impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str> {
830830
#[inline]
831-
fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&**self, &**other) }
831+
fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&self[..], &other[..]) }
832832
#[inline]
833-
fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&**self, &**other) }
833+
fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&self[..], &other[..]) }
834834
}
835835

836836
#[stable(feature = "rust1", since = "1.0.0")]
837837
impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str {
838838
#[inline]
839-
fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&**self, &**other) }
839+
fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&self[..], &other[..]) }
840840
#[inline]
841-
fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&**self, &**other) }
841+
fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&self[..], &other[..]) }
842842
}
843843

844844
#[unstable(feature = "collections", reason = "waiting on Str stabilization")]

0 commit comments

Comments
 (0)