ref: Use Duration helper methods for hours and minutes#503
Merged
Conversation
Codecov Report❌ Patch coverage is
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
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lcian
approved these changes
Jun 18, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
Duration::from_secsarithmetic withDuration::from_hoursandDuration::from_minswhere the intent is hours or minutes. Expressions likefrom_secs(2 * 24 * 3600)becomefrom_hours(2 * 24), andfrom_secs(3600)becomesfrom_hours(1).Duration::from_dayswould be preferable in some cases (e.g.,from_hours(90 * 24)) but it's still nightly-only (duration_constructors_lite, #141881).