From 656ea955625fa362d254cb8c7a1c895bcfac9b15 Mon Sep 17 00:00:00 2001 From: Canop Date: Sun, 24 Dec 2023 14:56:50 +0100 Subject: [PATCH] fix screen not always cleared when cargo is in quiet mode Fix #131 --- CHANGELOG.md | 3 +++ Cargo.lock | 2 +- src/app.rs | 12 ++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 895f563..b1dc779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### next +- fix output not cleared when cargo is in quiet mode and there's nothing - Fix #131 + ### v2.14.0 - 2023/10/04 - F5 now clears the output before running the job (now bound to `refresh` internal) diff --git a/Cargo.lock b/Cargo.lock index 77b6a3a..00e4667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,7 +136,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bacon" -version = "2.14.1" +version = "2.14.1-dev" dependencies = [ "anyhow", "cargo_metadata", diff --git a/src/app.rs b/src/app.rs index 47a7ab6..c7dc2a7 100644 --- a/src/app.rs +++ b/src/app.rs @@ -110,14 +110,10 @@ pub fn run( CommandExecInfo::End { status } => { info!("execution finished with status: {:?}", status); // computation finished - if let Some(output) = state.take_output() { - let cmd_result = CommandResult::new(output, status)?; - state.set_result(cmd_result); - action = state.action(); - } else { - warn!("a computation finished but didn't start?"); - state.computation_stops(); - } + let output = state.take_output().unwrap_or_default(); + let cmd_result = CommandResult::new(output, status)?; + state.set_result(cmd_result); + action = state.action(); } CommandExecInfo::Error(e) => { warn!("error in computation: {}", e);