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 +9
-23
lines changed Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -902,21 +902,6 @@ impl<'a> Builder<'a> {
902
902
Self :: new_internal ( build, kind, paths. to_owned ( ) )
903
903
}
904
904
905
- /// Creates a new standalone builder for use outside of the normal process
906
- pub fn new_standalone (
907
- build : & mut Build ,
908
- kind : Kind ,
909
- paths : Vec < PathBuf > ,
910
- stage : Option < u32 > ,
911
- ) -> Builder < ' _ > {
912
- // FIXME: don't mutate `build`
913
- if let Some ( stage) = stage {
914
- build. config . stage = stage;
915
- }
916
-
917
- Self :: new_internal ( build, kind, paths. to_owned ( ) )
918
- }
919
-
920
905
pub fn execute_cli ( & self ) {
921
906
self . run_step_descriptions ( & Builder :: get_step_descriptions ( self . kind ) , & self . paths ) ;
922
907
}
Original file line number Diff line number Diff line change @@ -4,10 +4,9 @@ use std::str::FromStr;
4
4
5
5
use std:: path:: PathBuf ;
6
6
7
- use crate :: {
8
- builder:: { Builder , Kind } ,
9
- tool:: Tool ,
10
- } ;
7
+ use clap:: Parser ;
8
+
9
+ use crate :: { builder:: Builder , tool:: Tool } ;
11
10
12
11
#[ cfg( feature = "build-metrics" ) ]
13
12
pub fn suggest ( builder : & Builder < ' _ > , run : bool ) {
@@ -68,11 +67,13 @@ pub fn suggest(builder: &Builder<'_>, run: bool) {
68
67
if run {
69
68
for sug in suggestions {
70
69
let mut build = builder. build . clone ( ) ;
70
+ build. config . paths = sug. 2 ;
71
+ build. config . cmd = crate :: flags:: Flags :: parse_from ( [ sug. 0 ] ) . cmd ;
72
+ if let Some ( stage) = sug. 1 {
73
+ build. config . stage = stage;
74
+ }
71
75
72
- let builder =
73
- Builder :: new_standalone ( & mut build, Kind :: parse ( & sug. 0 ) . unwrap ( ) , sug. 2 , sug. 1 ) ;
74
-
75
- builder. execute_cli ( )
76
+ Builder :: new ( & build) . execute_cli ( )
76
77
}
77
78
} else {
78
79
println ! ( "help: consider using the `--run` flag to automatically run suggested tests" ) ;
You can’t perform that action at this time.
0 commit comments