Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody committed Jun 24, 2024
1 parent b37bdf3 commit 4cb0bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/rate_limit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl RateLimitBuilder {
let quota = build_quota(burst, period);
let limiter = RateLimiter::direct(quota);

for (method, weight) in &method_weights.0 {
for (method, weight) in method_weights.0.as_ref() {
if let Some(n) = NonZeroU32::new(*weight) {
if limiter.check_n(n).is_err() {
bail!("`{method}` weight config too big for connection rate limit: {}", n);
Expand All @@ -118,7 +118,7 @@ impl RateLimitBuilder {
let quota = build_quota(burst, period);
let limiter = RateLimiter::direct(quota);

for (method, weight) in &method_weights.0 {
for (method, weight) in method_weights.0.as_ref() {
if let Some(n) = NonZeroU32::new(*weight) {
if limiter.check_n(n).is_err() {
bail!("`{method}` weight config too big for ip rate limit: {}", n);
Expand Down

0 comments on commit 4cb0bd4

Please sign in to comment.