This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
src/tools/run-make-support/src Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 11use std:: env;
2+ use std:: ffi:: OsStr ;
23use std:: path:: Path ;
34use std:: process:: { Command , Output } ;
45
@@ -58,18 +59,12 @@ impl Rustdoc {
5859 self
5960 }
6061
61- /// Fallback argument provider. Consider adding meaningfully named methods instead of using
62- /// this method.
63- pub fn arg ( & mut self , arg : & str ) -> & mut Self {
62+ /// Generic command argument provider. Use `.arg("-Zname")` over `.arg("-Z").arg("arg")`.
63+ pub fn arg < S : AsRef < OsStr > > ( & mut self , arg : S ) -> & mut Self {
6464 self . cmd . arg ( arg) ;
6565 self
6666 }
6767
68- pub fn arg_path < P : AsRef < Path > > ( & mut self , path : P ) -> & mut Self {
69- self . cmd . arg ( path. as_ref ( ) ) ;
70- self
71- }
72-
7368 /// Run the build `rustdoc` command and assert that the run is successful.
7469 #[ track_caller]
7570 pub fn run ( & mut self ) -> Output {
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ fn main() {
2525
2626 rustdoc ( )
2727 . arg ( "success.rs" )
28- . arg ( "-o" ) . arg_path ( tmp_dir ( ) . join ( "exit-code" ) )
28+ . arg ( "-o" )
29+ . arg ( tmp_dir ( ) . join ( "exit-code" ) )
2930 . run ( ) ;
3031
3132 rustdoc ( )
You can’t perform that action at this time.
0 commit comments