Implement PartialEq between &str and OsString
Allows for example `os_string == "something"`
This commit is contained in:
parent
6e5e63a48c
commit
02503029b8
1 changed files with 14 additions and 0 deletions
|
@ -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 {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue