diff options
| author | Zeyla Hellyer <[email protected]> | 2017-10-10 21:09:17 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-11 20:59:34 -0700 |
| commit | 483b069cc0c821ec673ac475b168809e3a41525a (patch) | |
| tree | 32fc42c8c0a5d65cd81b8044dd60e9e73a26f526 /src/http | |
| parent | Add env_logger bot example (diff) | |
| download | serenity-483b069cc0c821ec673ac475b168809e3a41525a.tar.xz serenity-483b069cc0c821ec673ac475b168809e3a41525a.zip | |
Fix clippy lints
Diffstat (limited to 'src/http')
| -rw-r--r-- | src/http/mod.rs | 2 | ||||
| -rw-r--r-- | src/http/ratelimiting.rs | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs index 1828bd7..0abed02 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -1632,7 +1632,7 @@ pub fn send_files<'a, T, It: IntoIterator<Item=T>>(channel_id: u64, files: It, m let mut request = Multipart::from_request(request)?; let mut file_num = "0".to_string(); - for file in files.into_iter() { + for file in files { match file.into() { AttachmentType::Bytes((mut bytes, filename)) => { request 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); |