diff options
| author | 5225225 <5225225@mailbox.org> | 2024-04-09 19:55:06 +0100 |
|---|---|---|
| committer | 5225225 <5225225@mailbox.org> | 2024-04-09 19:55:06 +0100 |
| commit | de79a6c08405bbaaa7fa9431d26ae0bacdfb0213 (patch) | |
| tree | fe64f81ae82b99f6cf632d47e9f1093b9fa7ee3d /src | |
| parent | 65df93bbb43c054cb413c8e22543e615d68957d8 (diff) | |
| download | rust-de79a6c08405bbaaa7fa9431d26ae0bacdfb0213.tar.gz rust-de79a6c08405bbaaa7fa9431d26ae0bacdfb0213.zip | |
run-make: make arg take AsRef<OsStr> instead of str
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/run-make-support/src/rustdoc.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs index cbf328b67fd..1fb4b589d76 100644 --- a/src/tools/run-make-support/src/rustdoc.rs +++ b/src/tools/run-make-support/src/rustdoc.rs @@ -1,4 +1,5 @@ use std::env; +use std::ffi::OsStr; use std::path::Path; use std::process::{Command, Output}; @@ -58,18 +59,12 @@ impl Rustdoc { self } - /// Fallback argument provider. Consider adding meaningfully named methods instead of using - /// this method. - pub fn arg(&mut self, arg: &str) -> &mut Self { + /// Generic command argument provider. Use `.arg("-Zname")` over `.arg("-Z").arg("arg")`. + pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self { self.cmd.arg(arg); self } - pub fn arg_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self { - self.cmd.arg(path.as_ref()); - self - } - /// Run the build `rustdoc` command and assert that the run is successful. #[track_caller] pub fn run(&mut self) -> Output { |
