Implement PartialEq between &str and OsString
Allows for example `os_string == "something"`
This commit is contained in:
@@ -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 {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user