correct arithmetic adjustments

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-05 20:40:58 -04:00 committed by June
parent 16a98b0683
commit 321e197d8c
12 changed files with 24 additions and 53 deletions

View file

@ -1395,13 +1395,7 @@ async fn validate_and_add_event_id(
e.insert((Instant::now(), 1));
},
Entry::Occupied(mut e) => {
*e.get_mut() = (
Instant::now(),
e.get()
.1
.checked_add(1)
.expect("bad_event_ratelimiter attempt/try count should not ever get this high"),
);
*e.get_mut() = (Instant::now(), e.get().1.saturating_add(1));
},
}
};