correct arithmetic adjustments
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
16a98b0683
commit
321e197d8c
12 changed files with 24 additions and 53 deletions
|
@ -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));
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue