From 8f9d0f12ebb4de99c3d907924bafd6dbc84f73f6 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 5 Jul 2021 00:05:46 +0100 Subject: [PATCH] Use AsRef in CommandExt for raw_arg --- library/std/src/os/windows/process.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs index 48c3d7bbd17..9e7ccd015b6 100644 --- a/library/std/src/os/windows/process.rs +++ b/library/std/src/os/windows/process.rs @@ -132,7 +132,7 @@ pub trait CommandExt: Sealed { /// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow /// `CommandLineToArgvW` escaping rules. #[unstable(feature = "windows_process_extensions_raw_arg", issue = "29494")] - fn raw_arg(&mut self, text_to_append_as_is: &OsStr) -> &mut process::Command; + fn raw_arg>(&mut self, text_to_append_as_is: S) -> &mut process::Command; } #[stable(feature = "windows_process_extensions", since = "1.16.0")] @@ -147,8 +147,8 @@ impl CommandExt for process::Command { self } - fn raw_arg(&mut self, raw_text: &OsStr) -> &mut process::Command { - self.as_inner_mut().raw_arg(raw_text); + fn raw_arg>(&mut self, raw_text: S) -> &mut process::Command { + self.as_inner_mut().raw_arg(raw_text.as_ref()); self } }