Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

refactor(progress): dedupe 4 identical SystemTime::now() blocks via now_secs() helper - #705

Merged
shiba4life merged 1 commit into
mainfrom
refactor/progress-now-secs-helper
May 11, 2026
Merged

refactor(progress): dedupe 4 identical SystemTime::now() blocks via now_secs() helper#705
shiba4life merged 1 commit into
mainfrom
refactor/progress-now-secs-helper

Conversation

@shiba4life

Copy link
Copy Markdown
Collaborator

Replaces 4 identical SystemTime::now()...unwrap_or_default().as_secs() chains in Job::new / update_progress / complete / fail with a single private now_secs() helper at the top of crates/core/src/progress.rs.

Behavior-preserving (preserves .unwrap_or_default() semantics — returns 0 on clock-before-epoch). Single-file change. Net: -16/+11 LOC.

Verification

  • cargo fmt --check — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace --all-targets — all green
  • rg -n 'SystemTime::now\(\)' crates/core/src/progress.rs — 1 hit (helper definition)

…ow_secs() helper

Replaces 4 identical SystemTime::now().duration_since(UNIX_EPOCH).unwrap_or_default().as_secs()
chains in Job::new/update_progress/complete/fail with a single private now_secs() helper.
Behavior-preserving (preserves .unwrap_or_default semantics — returns 0 on clock-before-epoch).
Single-file change.
@shiba4life
shiba4life enabled auto-merge May 11, 2026 23:32
@shiba4life
shiba4life added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 8986216 May 11, 2026
14 checks passed
@shiba4life
shiba4life deleted the refactor/progress-now-secs-helper branch May 11, 2026 23:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant