Commit 3e2a4b2
committed
clippy lint in Instant::duration_since
Fixes a new CI error in Rust 1.94:
error: manual saturating arithmetic
--> src/time/instant.rs:33:30
|
33 | Duration::from_nanos(self.0.checked_sub(earlier.0).unwrap_or_default())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_sub`: `self.0.saturating_sub(earlier.0)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#manual_saturating_arithmetic
= note: `-D clippy::manual-saturating-arithmetic` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_saturating_arithmetic)]`1 parent 529fc0d commit 3e2a4b2
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments