refactor(RateLimitConfig): replace magic values with struct method

This commit is contained in:
2026-06-02 01:04:24 +02:00
parent 85621d9364
commit b29a095a38
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -35,6 +35,15 @@ impl RateLimitConfig {
}
}
/// Return default values for disabling rate limiting.
#[must_use]
pub const fn disabled() -> Self {
Self {
burst_size: u32::MAX,
per_seconds: 1,
}
}
/// Creates a rate limiter from this configuration.
///
/// # Panics