Skip to content

Commit 8f9d0f1

Browse files
committed
Use AsRef in CommandExt for raw_arg
1 parent d868da7 commit 8f9d0f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/os/windows/process.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub trait CommandExt: Sealed {
132132
/// This is useful for passing arguments to `cmd.exe /c`, which doesn't follow
133133
/// `CommandLineToArgvW` escaping rules.
134134
#[unstable(feature = "windows_process_extensions_raw_arg", issue = "29494")]
135-
fn raw_arg(&mut self, text_to_append_as_is: &OsStr) -> &mut process::Command;
135+
fn raw_arg<S: AsRef<OsStr>>(&mut self, text_to_append_as_is: S) -> &mut process::Command;
136136
}
137137

138138
#[stable(feature = "windows_process_extensions", since = "1.16.0")]
@@ -147,8 +147,8 @@ impl CommandExt for process::Command {
147147
self
148148
}
149149

150-
fn raw_arg(&mut self, raw_text: &OsStr) -> &mut process::Command {
151-
self.as_inner_mut().raw_arg(raw_text);
150+
fn raw_arg<S: AsRef<OsStr>>(&mut self, raw_text: S) -> &mut process::Command {
151+
self.as_inner_mut().raw_arg(raw_text.as_ref());
152152
self
153153
}
154154
}

0 commit comments

Comments
 (0)