about summary refs log tree commit diff
path: root/library/std/src/os
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2021-07-05 00:05:46 +0100
committerKornel <kornel@cloudflare.com>2021-07-09 14:09:48 +0100
commit8f9d0f12ebb4de99c3d907924bafd6dbc84f73f6 (patch)
tree71939853b4e73258f389a47f2ed327d0bb55e95c /library/std/src/os
parentd868da7796bfb96e87e09afc4e8338911b5f99b3 (diff)
downloadrust-8f9d0f12ebb4de99c3d907924bafd6dbc84f73f6.tar.gz
rust-8f9d0f12ebb4de99c3d907924bafd6dbc84f73f6.zip
Use AsRef in CommandExt for raw_arg
Diffstat (limited to 'library/std/src/os')
-rw-r--r--library/std/src/os/windows/process.rs6
1 files 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<S: AsRef<OsStr>>(&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<S: AsRef<OsStr>>(&mut self, raw_text: S) -> &mut process::Command {
+        self.as_inner_mut().raw_arg(raw_text.as_ref());
         self
     }
 }