Skip to content

ref: Use Duration helper methods for hours and minutes#503

Merged
jan-auer merged 1 commit into
mainfrom
ref/duration-units
Jun 18, 2026
Merged

ref: Use Duration helper methods for hours and minutes#503
jan-auer merged 1 commit into
mainfrom
ref/duration-units

Conversation

@jan-auer

Copy link
Copy Markdown
Member

Replace Duration::from_secs arithmetic with Duration::from_hours and Duration::from_mins where the intent is hours or minutes. Expressions like from_secs(2 * 24 * 3600) become from_hours(2 * 24), and from_secs(3600) becomes from_hours(1).

Duration::from_days would be preferable in some cases (e.g., from_hours(90 * 24)) but it's still nightly-only (duration_constructors_lite, #141881).

@jan-auer jan-auer requested a review from a team as a code owner June 18, 2026 13:03
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.38%. Comparing base (c74e688) to head (851a9ca).

Files with missing lines Patch % Lines
bigtable-bench/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #503   +/-   ##
=======================================
  Coverage   87.38%   87.38%           
=======================================
  Files          86       86           
  Lines       13825    13825           
=======================================
  Hits        12081    12081           
  Misses       1744     1744           
Components Coverage Δ
Rust Backend 92.19% <100.00%> (ø)
Rust Client 80.06% <ø> (ø)
Python Client 88.51% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jan-auer jan-auer enabled auto-merge (squash) June 18, 2026 13:05
@jan-auer jan-auer merged commit 7381324 into main Jun 18, 2026
25 checks passed
@jan-auer jan-auer deleted the ref/duration-units branch June 18, 2026 13:07
jan-auer added a commit that referenced this pull request Jun 18, 2026
Follow-up to #503 — one missed `Duration::from_secs(120)` →
`Duration::from_mins(2)` in the metadata test. Clears the last
`clippy::duration_suboptimal_units` warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants