Closed
Description
I've just got very surprised to find out that my_os_string == "foo"
doesn't compile, but my_os_string == *"foo"
does. After some investigation, I found that impl<'a> PartialEq<&'a str> for OsString
is missing. Similar impl is present for String
though.
I believe it'd be nice to implement it.
Activity
csmoe commentedon Apr 13, 2018
&OsStr
is toOsString
as&str
is toString
, so check outimpl<'a, 'b> PartialEq<&'a OsStr> for OsString
, this implementation might meet your needs.Kixunil commentedon Apr 19, 2018
@csmoe I've soled my problem immediately. I filed issue because I think we could help others by implementing the trait.
Rollup merge of rust-lang#51178 - GabrielMajeri:os-str-compare, r=Sim…
Auto merge of #51178 - GabrielMajeri:os-str-compare, r=SimonSapin