From 38d11e7ef8d35818c20fc6b99581b6c251db6bce Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 21 Jan 2025 17:15:36 -0600 Subject: [PATCH] Explicitly call done on timer --- shared/src/output.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shared/src/output.rs b/shared/src/output.rs index 4b404aeb..d3e2c769 100644 --- a/shared/src/output.rs +++ b/shared/src/output.rs @@ -41,8 +41,10 @@ pub fn print_error(title: impl AsRef, body: impl Into) pub fn run_command(mut command: Command, quiet: bool) -> Result { let title = format!("Running {}", style::value(command.name())); if quiet { - let _timer = print::sub_start_timer(title); - command.named_output() + let timer = print::sub_start_timer(title); + let output = command.named_output(); + let _ = timer.done(); + output } else { print::sub_stream_with(&title, |stdout, stderr| { command.stream_output(stdout, stderr) @@ -210,8 +212,10 @@ pub fn track_timing_subsection(title: impl Into, f: F where F: FnOnce() -> E, { - let _timer = print::sub_start_timer(title.into().to_ansi_string()); - f() + let timer = print::sub_start_timer(title.into().to_ansi_string()); + let output = f(); + let _ = timer.done(); + output } const VALUE_DELIMITER_CHAR: char = '`';