rust/tests
Samuel Tardieu 331a474142
Add new duration_suboptimal_units lint (#16250)
`Duration::from_mins` and `Duration::from_hours` where [recently
stabilized](https://github.com/rust-lang/rust/issues/140881) in Rust
1.91.0.

In our codebase we often times have things like

```rust
Duration::from_secs(5 * 60);
// Since Rust 1.91.0 one can use
Duration::from_mins(5)
```

During the Rust 1.91.0 bump I noticed we can finally switch to
`Duration::from_mins(5)`, but many users might not be aware of this. I
started manually updating the places, but halfway through I figured
"Can't a lint do this for me?", so I added exactly that in this PR. It
does it for all stabilized `from_XXX` time units.

changelog: Add new [`duration_suboptimal_units`] lint
Closes rust-lang/rust-clippy#16335
2026-01-09 16:08:40 +00:00
..
test_utils
ui Add new duration_suboptimal_units lint (#16250) 2026-01-09 16:08:40 +00:00
ui-cargo Merge commit 'd9fb15c4b1' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
ui-internal Merge commit '99edcadfd5' into clippy-subtree-update 2025-12-25 23:24:43 +01:00
ui-toml missing_enforced_import_rename: Do not enforce for underscores 2026-01-07 17:29:11 +00:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs miri: add -Zbinary-dep-depinfo to dependency builds 2025-12-11 18:56:45 +01:00
config-consistency.rs Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
config-metadata.rs
dogfood.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
no-profile-in-cargo-toml.rs Merge commit '20ce69b9a6' into clippy-subtree-update 2025-09-18 17:21:44 +02:00
symbols-used.rs Merge commit 'd9fb15c4b1' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
versioncheck.rs
workspace.rs