aboutsummaryrefslogtreecommitdiff
path: root/src/http/ratelimiting.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-10-10 21:09:17 -0700
committerZeyla Hellyer <[email protected]>2017-10-11 20:59:34 -0700
commit483b069cc0c821ec673ac475b168809e3a41525a (patch)
tree32fc42c8c0a5d65cd81b8044dd60e9e73a26f526 /src/http/ratelimiting.rs
parentAdd env_logger bot example (diff)
downloadserenity-483b069cc0c821ec673ac475b168809e3a41525a.tar.xz
serenity-483b069cc0c821ec673ac475b168809e3a41525a.zip
Fix clippy lints
Diffstat (limited to 'src/http/ratelimiting.rs')
-rw-r--r--src/http/ratelimiting.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs
index ed3eb71..dbaca6b 100644
--- a/src/http/ratelimiting.rs
+++ b/src/http/ratelimiting.rs
@@ -362,7 +362,7 @@ pub(crate) fn perform<'a, F>(route: Route, f: F) -> Result<Response>
// - get the global rate;
// - sleep if there is 0 remaining
// - then, perform the request
- let bucket = ROUTES
+ let bucket = Arc::clone(ROUTES
.lock()
.expect("routes poisoned")
.entry(route)
@@ -372,8 +372,7 @@ pub(crate) fn perform<'a, F>(route: Route, f: F) -> Result<Response>
remaining: i64::MAX,
reset: i64::MAX,
}))
- })
- .clone();
+ }));
let mut lock = bucket.lock().unwrap();
lock.pre_hook(&route);