We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
str
&str
1 parent 90d7338 commit 7e4c0a0Copy full SHA for 7e4c0a0
src/libcore/str/mod.rs
@@ -1608,6 +1608,22 @@ mod traits {
1608
fn ne(&self, other: &str) -> bool { !(*self).eq(other) }
1609
}
1610
1611
+ #[stable(feature = "rust1", since = "1.24.0")]
1612
+ impl<'a> PartialEq<&'a str> for str {
1613
+ #[inline]
1614
+ fn eq(&self, other: &&'a str) -> bool { self == *other }
1615
1616
+ fn ne(&self, other: &&'a str) -> bool { self != *other }
1617
+ }
1618
+
1619
1620
+ impl<'a> PartialEq<str> for &'a str {
1621
1622
+ fn eq(&self, other: &str) -> bool { *self == other }
1623
1624
+ fn ne(&self, other: &str) -> bool { *self != other }
1625
1626
1627
#[stable(feature = "rust1", since = "1.0.0")]
1628
impl Eq for str {}
1629
0 commit comments