Skip to content

Commit

Permalink
Invokes checked_add when calling sub
Browse files Browse the repository at this point in the history
The current implementation invoked checked_add which
is the inverse actually.
  • Loading branch information
andyHa authored Oct 14, 2020
1 parent 811ed63 commit 0bd412c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl std::ops::Sub for Instant {
impl std::ops::Sub<Duration> for Instant {
type Output = Instant;
fn sub(self, rhs: Duration) -> Self::Output {
self.checked_add(rhs)
self.checked_sub(rhs)
.expect("overflow when substracting duration from instant")
}
}
Expand Down

0 comments on commit 0bd412c

Please sign in to comment.