style: token bucket dead code false positive

This commit is contained in:
Mingwei Samuel 2025-01-13 11:37:06 -08:00
parent 318ac138c5
commit 29a2819341
2 changed files with 3 additions and 1 deletions

View file

@ -242,7 +242,7 @@ impl RateLimit {
}
}
fn buckets_require_updating(limit_header: &str, buckets: &[VectorTokenBucket]) -> bool {
fn buckets_require_updating(limit_header: &str, buckets: &[impl TokenBucket]) -> bool {
if buckets.len() != limit_header.split(',').count() {
return true;
}

View file

@ -30,11 +30,13 @@ pub trait TokenBucket {
/// Get the duration of this bucket.
/// # Returns
/// Duration of the bucket.
#[allow(dead_code, reason = "false positive")]
fn get_bucket_duration(&self) -> Duration;
/// Get the total limit of this bucket per timespan.
/// # Returns
/// Total limit per timespan.
#[allow(dead_code, reason = "false positive")]
fn get_total_limit(&self) -> usize;
}