Skip to content

Commit c9eeeb4

Browse files
committed
remove check_run function from helpers
1 parent b5db059 commit c9eeeb4

File tree

3 files changed

+9
-27
lines changed

3 files changed

+9
-27
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ impl Config {
13791379
.run_always()
13801380
.args(["submodule", "-q", "sync"])
13811381
.arg(relative_path)
1382-
.run(&self);
1382+
.run(self);
13831383

13841384
// Try passing `--progress` to start, then run git again without if that fails.
13851385
let update = |progress: bool| {
@@ -1408,23 +1408,23 @@ impl Config {
14081408
git.arg(relative_path);
14091409
git
14101410
};
1411-
if !update(true).allow_failure().run(&self) {
1412-
update(false).allow_failure().run(&self);
1411+
if !update(true).allow_failure().run(self) {
1412+
update(false).allow_failure().run(self);
14131413
}
14141414

14151415
// Save any local changes, but avoid running `git stash pop` if there are none (since it will exit with an error).
14161416
// diff-index reports the modifications through the exit status
14171417
let has_local_modifications =
1418-
!submodule_git().allow_failure().args(["diff-index", "--quiet", "HEAD"]).run(&self);
1418+
!submodule_git().allow_failure().args(["diff-index", "--quiet", "HEAD"]).run(self);
14191419
if has_local_modifications {
1420-
submodule_git().allow_failure().args(["stash", "push"]).run(&self);
1420+
submodule_git().allow_failure().args(["stash", "push"]).run(self);
14211421
}
14221422

1423-
submodule_git().allow_failure().args(["reset", "-q", "--hard"]).run(&self);
1424-
submodule_git().allow_failure().args(["clean", "-qdfx"]).run(&self);
1423+
submodule_git().allow_failure().args(["reset", "-q", "--hard"]).run(self);
1424+
submodule_git().allow_failure().args(["clean", "-qdfx"]).run(self);
14251425

14261426
if has_local_modifications {
1427-
submodule_git().allow_failure().args(["stash", "pop"]).run(&self);
1427+
submodule_git().allow_failure().args(["stash", "pop"]).run(self);
14281428
}
14291429
}
14301430

src/bootstrap/src/core/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl Config {
244244
curl.arg("--retry-all-errors");
245245
}
246246
curl.arg(url);
247-
if !curl.run(&self) {
247+
if !curl.run(self) {
248248
if self.host_target.contains("windows-msvc") {
249249
eprintln!("Fallback to PowerShell");
250250
for _ in 0..3 {

src/bootstrap/src/utils/helpers.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -270,24 +270,6 @@ pub fn is_valid_test_suite_arg<'a, P: AsRef<Path>>(
270270
}
271271
}
272272

273-
// FIXME: get rid of this function
274-
pub fn check_run(cmd: &mut BootstrapCommand, print_cmd_on_fail: bool) -> bool {
275-
let status = match cmd.as_command_mut().status() {
276-
Ok(status) => status,
277-
Err(e) => {
278-
println!("failed to execute command: {cmd:?}\nERROR: {e}");
279-
return false;
280-
}
281-
};
282-
if !status.success() && print_cmd_on_fail {
283-
println!(
284-
"\n\ncommand did not execute successfully: {cmd:?}\n\
285-
expected success, got: {status}\n\n"
286-
);
287-
}
288-
status.success()
289-
}
290-
291273
pub fn make(host: &str) -> PathBuf {
292274
if host.contains("dragonfly")
293275
|| host.contains("freebsd")

0 commit comments

Comments
 (0)