File tree 2 files changed +5
-9
lines changed
src/tools/run-make-support/src
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
+ use std:: ffi:: OsStr ;
2
3
use std:: path:: Path ;
3
4
use std:: process:: { Command , Output } ;
4
5
@@ -58,18 +59,12 @@ impl Rustdoc {
58
59
self
59
60
}
60
61
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 {
64
64
self . cmd . arg ( arg) ;
65
65
self
66
66
}
67
67
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
-
73
68
/// Run the build `rustdoc` command and assert that the run is successful.
74
69
#[ track_caller]
75
70
pub fn run ( & mut self ) -> Output {
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ fn main() {
25
25
26
26
rustdoc ( )
27
27
. arg ( "success.rs" )
28
- . arg ( "-o" ) . arg_path ( tmp_dir ( ) . join ( "exit-code" ) )
28
+ . arg ( "-o" )
29
+ . arg ( tmp_dir ( ) . join ( "exit-code" ) )
29
30
. run ( ) ;
30
31
31
32
rustdoc ( )
You can’t perform that action at this time.
0 commit comments