summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-07-02 01:06:40 -0700
committeriximeow <me@iximeow.net>2023-07-02 01:06:40 -0700
commitd22d4794a1e4c4794d7c300d1ffff3af56385930 (patch)
tree2f06f8f031e8377779c7481a8441f25ca429d598 /src
parentac6e821638fe8254682a6e84761a20e460b25adf (diff)
better description for reaped tasks
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files 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()