Skip to content

Commit

Permalink
rustbuild: rename exec_cmd -> status_code for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
infinity0 committed Jul 27, 2020
1 parent 0cf17e7 commit b99668b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn main() {
e => e,
};
println!("\nDid not run successfully: {:?}\n{:?}\n-------------", e, cmd);
exec_cmd(&mut on_fail).expect("could not run the backup command");
status_code(&mut on_fail).expect("could not run the backup command");
std::process::exit(1);
}

Expand Down Expand Up @@ -182,10 +182,10 @@ fn main() {
}
}

let code = exec_cmd(&mut cmd).unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
let code = status_code(&mut cmd).unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
std::process::exit(code);
}

fn exec_cmd(cmd: &mut Command) -> io::Result<i32> {
fn status_code(cmd: &mut Command) -> io::Result<i32> {
cmd.status().map(|status| status.code().unwrap())
}

0 comments on commit b99668b

Please sign in to comment.