Skip to content

Commit

Permalink
Prevent overflow when substracting durations
Browse files Browse the repository at this point in the history
  • Loading branch information
YS-L committed Apr 27, 2024
1 parent a2715c9 commit 69c6b5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl CsvlensEvents {
}
_ => {
let time_spent = now.elapsed();
let rest = self.tick_rate - time_spent;
let rest = self.tick_rate.saturating_sub(time_spent);

Self { tick_rate: rest }.next()
}
Expand Down

0 comments on commit 69c6b5f

Please sign in to comment.