From d22d4794a1e4c4794d7c300d1ffff3af56385930 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 2 Jul 2023 01:06:40 -0700 Subject: better description for reaped tasks --- src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6f49cc8..5f9567a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,10 +169,14 @@ fn display_run_time(run: &Run) -> String { duration } } else { - let now_ms = SystemTime::now().duration_since(UNIX_EPOCH).expect("now is after then").as_millis() as u64; - let mut duration = duration_as_human_string(now_ms - start_time); - duration.push_str(" (ongoing)"); - duration + if run.state != RunState::Invalid { + let now_ms = SystemTime::now().duration_since(UNIX_EPOCH).expect("now is after then").as_millis() as u64; + let mut duration = duration_as_human_string(now_ms - start_time); + duration.push_str(" (ongoing)"); + duration + } else { + "n/a".to_string() + } } } else { "not yet run".to_owned() -- cgit v1.1