We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72ab91d commit 0dd6ce0Copy full SHA for 0dd6ce0
clippy_lints/src/instant_subtraction.rs
@@ -49,11 +49,13 @@ declare_clippy_lint! {
49
///
50
/// ### Example
51
/// ```rust
52
+ /// # use std::time::{Instant, Duration};
53
/// let time_passed = Instant::now() - Duration::from_secs(5);
54
/// ```
55
56
/// Use instead:
57
58
59
/// let time_passed = Instant::now().checked_sub(Duration::from_secs(5));
60
61
0 commit comments