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
|
@ -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));
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue