Skip to content

Commit d7d5ef1

Browse files
Jason Barnettclaude
andcommitted
refactor: always show elapsed time for all workunit states
Address review feedback: show elapsed time for all workunits (starting, completed, canceled) instead of only completed and canceled. Since all match arms now return a value, simplify from Option<String> to String. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ad7629b commit d7d5ef1

File tree

1 file changed

+5
-7
lines changed
  • src/rust/workunit_store/src

1 file changed

+5
-7
lines changed

src/rust/workunit_store/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,14 @@ impl Workunit {
269269
(WorkunitState::Completed { .. }, _) => "Completed:",
270270
};
271271

272-
let duration_str: Option<String> = match &self.state {
272+
let duration_str = match &self.state {
273273
WorkunitState::Completed { time_span } => {
274-
Some(format_workunit_duration(std::time::Duration::from(time_span.duration)))
274+
format_workunit_duration(std::time::Duration::from(time_span.duration))
275275
}
276-
WorkunitState::Started { start_time, .. } if canceled => {
276+
WorkunitState::Started { start_time, .. } => {
277277
let elapsed = start_time.elapsed().unwrap_or_default();
278-
Some(format_workunit_duration(elapsed))
278+
format_workunit_duration(elapsed)
279279
}
280-
_ => None,
281280
};
282281

283282
let identifier = if let Some(ref s) = metadata.desc {
@@ -309,8 +308,7 @@ impl Workunit {
309308

310309
log!(
311310
self.level,
312-
"{state} {effective_identifier}{}{message}",
313-
duration_str.as_deref().unwrap_or("")
311+
"{state} {effective_identifier}{duration_str}{message}",
314312
);
315313
}
316314
}

0 commit comments

Comments
 (0)