Skip to content

Commit dea316a

Browse files
authored
Merge pull request #123 from bytecodealliance/pch/latest_rust_lint
clippy lint in Instant::duration_since
2 parents 529fc0d + 3e2a4b2 commit dea316a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/time/instant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl Instant {
3030
/// Returns the amount of time elapsed from another instant to this one, or zero duration if
3131
/// that instant is later than this one.
3232
pub fn duration_since(&self, earlier: Instant) -> Duration {
33-
Duration::from_nanos(self.0.checked_sub(earlier.0).unwrap_or_default())
33+
Duration::from_nanos(self.0.saturating_sub(earlier.0))
3434
}
3535

3636
/// Returns the amount of time elapsed since this instant.

0 commit comments

Comments
 (0)