aboutsummaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-14 22:41:25 +0200
committeracdenisSK <[email protected]>2017-10-14 22:41:25 +0200
commitcae014758a1d1e926a71679f02e32601c57f8d52 (patch)
tree39270dbc2df916a91c3c4272600fd082a2604516 /src/http
parentSwitch to parking_lot::{Mutex, RwLock} (diff)
parentRelease v0.4.1 (diff)
downloadserenity-cae014758a1d1e926a71679f02e32601c57f8d52.tar.xz
serenity-cae014758a1d1e926a71679f02e32601c57f8d52.zip
Update to account for changes made in 0.4.1
Diffstat (limited to 'src/http')
-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 09c2527..08dc9ee 100644
--- a/src/http/ratelimiting.rs
+++ b/src/http/ratelimiting.rs
@@ -361,7 +361,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()
.entry(route)
.or_insert_with(|| {
@@ -370,8 +370,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();
lock.pre_hook(&route);