diff --git a/crates/quark/src/web/ratelimiter.rs b/crates/quark/src/web/ratelimiter.rs index 0d264c72..70249842 100644 --- a/crates/quark/src/web/ratelimiter.rs +++ b/crates/quark/src/web/ratelimiter.rs @@ -25,7 +25,7 @@ use dashmap::DashMap; use once_cell::sync::Lazy; /// Ratelimit Bucket -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] struct Entry { used: u8, reset: u128, @@ -50,7 +50,7 @@ impl Entry { } /// Deduct one unit from the bucket and save - pub fn deduct(mut self) { + pub fn deduct(&mut self) { let current_time = now().as_millis(); if current_time > self.reset { self.used = 1; @@ -192,7 +192,7 @@ impl Ratelimiter { let key = key.finish(); let limit = resolve_bucket_limit(bucket); - let entry = Entry::from(key); + let mut entry = Entry::from(key); let remaining = entry.get_remaining(limit); if remaining > 0 {