From fe7e492572b61590209e91f2006fe76fd07ac8db Mon Sep 17 00:00:00 2001 From: rvcas Date: Sat, 3 Jul 2021 14:54:05 -0400 Subject: [PATCH] chore: cleaner way to check status code --- cli/src/build.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cli/src/build.rs b/cli/src/build.rs index 1682aff916..d75bf0361b 100644 --- a/cli/src/build.rs +++ b/cli/src/build.rs @@ -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,