chore: cleaner way to check status code

This commit is contained in:
rvcas 2021-07-03 14:54:05 -04:00
parent a82b403aa4
commit fe7e492572

View File

@ -214,14 +214,15 @@ pub fn build_file<'a>(
let total_time = compilation_start.elapsed().unwrap();
// TODO change this to report whether there were errors or warnings!
let outcome = match &cmd_result {
Ok(exit_status) if exit_status.success() => BuildOutcome::NoProblems,
_ => BuildOutcome::Errors,
};
// If the cmd errored out, return the Err.
cmd_result?;
let exit_status = cmd_result?;
// TODO change this to report whether there were errors or warnings!
let outcome = if exit_status.success() {
BuildOutcome::NoProblems
} else {
BuildOutcome::Errors
};
Ok(BuiltFile {
binary_path,