From 4d1efb751a8fd70a38c695a6047a837d115b8af5 Mon Sep 17 00:00:00 2001 From: Tyler Ruckinger Date: Wed, 3 Feb 2021 10:28:51 -0500 Subject: [PATCH] OsStr eq_ignore_ascii_case takes arg by value Per a comment on #70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef` 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::("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 #80193) then please just close this. --- library/std/src/ffi/os_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 21060182d60bc..c9c8f68cd9cce 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -826,7 +826,7 @@ impl OsStr { /// assert!(!OsString::from("Ferrös").eq_ignore_ascii_case("FERRÖS")); /// ``` #[unstable(feature = "osstring_ascii", issue = "70516")] - pub fn eq_ignore_ascii_case>(&self, other: &S) -> bool { + pub fn eq_ignore_ascii_case>(&self, other: S) -> bool { self.inner.eq_ignore_ascii_case(&other.as_ref().inner) } }