1
Fork 0

Implement PartialEq between &str and OsString

Allows for example `os_string == "something"`
This commit is contained in:
Gabriel Majeri 2018-05-29 19:16:49 +03:00
parent 6e5e63a48c
commit 02503029b8

View file

@ -417,6 +417,20 @@ impl PartialEq<OsString> for str {
}
}
#[stable(feature = "rust1", since = "1.28.0")]
impl<'a> PartialEq<&'a str> for OsString {
fn eq(&self, other: &&'a str) -> bool {
**self == **other
}
}
#[stable(feature = "rust1", since = "1.28.0")]
impl<'a> PartialEq<OsString> for &'a str {
fn eq(&self, other: &OsString) -> bool {
**other == **self
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Eq for OsString {}