Skip to content

Commit 79c6700

Browse files
committed
Remove unnecessary Builder::new_standalone function
1 parent 441972d commit 79c6700

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

src/bootstrap/builder.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff 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
}

src/bootstrap/suggest.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ use std::str::FromStr;
44

55
use 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")]
1312
pub 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");

0 commit comments

Comments
 (0)