We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 529fc0d + 3e2a4b2 commit dea316aCopy full SHA for dea316a
src/time/instant.rs
@@ -30,7 +30,7 @@ impl Instant {
30
/// Returns the amount of time elapsed from another instant to this one, or zero duration if
31
/// that instant is later than this one.
32
pub fn duration_since(&self, earlier: Instant) -> Duration {
33
- Duration::from_nanos(self.0.checked_sub(earlier.0).unwrap_or_default())
+ Duration::from_nanos(self.0.saturating_sub(earlier.0))
34
}
35
36
/// Returns the amount of time elapsed since this instant.
0 commit comments