mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2025-01-24 09:47:26 -08:00
style: token bucket dead code false positive
This commit is contained in:
parent
318ac138c5
commit
29a2819341
2 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue