mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-20 10:02:16 +00:00
Fix instant substractions that might have panicked
This commit is contained in:
@@ -36,7 +36,7 @@ impl Tranquilizer {
|
||||
}
|
||||
|
||||
fn tranquilize_internal(&mut self, tranquility: u32) -> Option<Duration> {
|
||||
let observation = Instant::now() - self.last_step_begin;
|
||||
let observation = Instant::now().saturating_duration_since(self.last_step_begin);
|
||||
|
||||
self.observations.push_back(observation);
|
||||
self.sum_observations += observation;
|
||||
|
||||
Reference in New Issue
Block a user