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

@ -340,13 +340,7 @@ pub(crate) async fn get_keys_helper<F: Fn(&UserId) -> bool>(
e.insert((Instant::now(), 1));
},
hash_map::Entry::Occupied(mut e) => {
*e.get_mut() = (
Instant::now(),
e.get()
.1
.checked_add(1)
.expect("bad_query_ratelimiter attempt/try count should not ever get this high"),
);
*e.get_mut() = (Instant::now(), e.get().1.saturating_add(1));
},
}
};