diff options
| author | acdenisSK <[email protected]> | 2017-10-14 22:41:25 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-10-14 22:41:25 +0200 |
| commit | cae014758a1d1e926a71679f02e32601c57f8d52 (patch) | |
| tree | 39270dbc2df916a91c3c4272600fd082a2604516 /src/http | |
| parent | Switch to parking_lot::{Mutex, RwLock} (diff) | |
| parent | Release v0.4.1 (diff) | |
| download | serenity-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.rs | 5 |
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); |