Skip to content

Commit 21e5827

Browse files
authored
Rollup merge of rust-lang#81710 - TyPR124:patch-2, r=m-ou-se
OsStr eq_ignore_ascii_case takes arg by value Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
2 parents 87b269a + 4d1efb7 commit 21e5827

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/ffi/os_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ impl OsStr {
826826
/// assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS"));
827827
/// ```
828828
#[unstable(feature = "osstring_ascii", issue = "70516")]
829-
pub fn eq_ignore_ascii_case<S: ?Sized + AsRef<OsStr>>(&self, other: &S) -> bool {
829+
pub fn eq_ignore_ascii_case<S: AsRef<OsStr>>(&self, other: S) -> bool {
830830
self.inner.eq_ignore_ascii_case(&other.as_ref().inner)
831831
}
832832
}

0 commit comments

Comments
 (0)