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> {
902902 Self :: new_internal ( build, kind, paths. to_owned ( ) )
903903 }
904904
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-
920905 pub fn execute_cli ( & self ) {
921906 self . run_step_descriptions ( & Builder :: get_step_descriptions ( self . kind ) , & self . paths ) ;
922907 }
Original file line number Diff line number Diff line change @@ -4,10 +4,9 @@ use std::str::FromStr;
44
55use std:: path:: PathBuf ;
66
7- use crate :: {
8- builder:: { Builder , Kind } ,
9- tool:: Tool ,
10- } ;
7+ use clap:: Parser ;
8+
9+ use crate :: { builder:: Builder , tool:: Tool } ;
1110
1211#[ cfg( feature = "build-metrics" ) ]
1312pub fn suggest ( builder : & Builder < ' _ > , run : bool ) {
@@ -68,11 +67,13 @@ pub fn suggest(builder: &Builder<'_>, run: bool) {
6867 if run {
6968 for sug in suggestions {
7069 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+ }
7175
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 ( )
7677 }
7778 } else {
7879 println ! ( "help: consider using the `--run` flag to automatically run suggested tests" ) ;
You can’t perform that action at this time.
0 commit comments