diff options
author | Alex Auvolat <alex@adnab.me> | 2022-09-29 15:53:54 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-09-29 15:53:54 +0200 |
commit | ad917ffd3f76316e48b89ff17e2f8a600a269481 (patch) | |
tree | 4411b84a2021eda2e98e38c4549ba00dc71dcef6 /src/util/tranquilizer.rs | |
parent | 497164d78253fa1dd3cdbfc8a5267edaab4040f3 (diff) | |
download | garage-ad917ffd3f76316e48b89ff17e2f8a600a269481.tar.gz garage-ad917ffd3f76316e48b89ff17e2f8a600a269481.zip |
Fix instant substractions that might have panickedfix-time
Diffstat (limited to 'src/util/tranquilizer.rs')
-rw-r--r-- | src/util/tranquilizer.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/tranquilizer.rs b/src/util/tranquilizer.rs index fdb2918b..8a96cbb3 100644 --- a/src/util/tranquilizer.rs +++ b/src/util/tranquilizer.rs @@ -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; |