aboutsummaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-05-23 22:42:41 -0700
committerZeyla Hellyer <[email protected]>2017-05-24 17:31:48 -0700
commit540aea32af7878293c72fe9cc2c2d3ce27a44c5e (patch)
tree4356b63961eb5754b29c6a99b4bc031c5d4240b1 /src/http
parentRemove unused internal macro (diff)
downloadserenity-540aea32af7878293c72fe9cc2c2d3ce27a44c5e.tar.xz
serenity-540aea32af7878293c72fe9cc2c2d3ce27a44c5e.zip
Clippy lints
Diffstat (limited to 'src/http')
-rw-r--r--src/http/ratelimiting.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs
index 2b467b5..9b6c049 100644
--- a/src/http/ratelimiting.rs
+++ b/src/http/ratelimiting.rs
@@ -379,7 +379,9 @@ pub fn perform<'a, F>(route: Route, f: F) -> Result<Response>
// It _may_ be possible for the limit to be raised at any time,
// so check if it did from the value of the 'x-ratelimit-limit'
// header. If the limit was 5 and is now 7, add 2 to the 'remaining'
- if route != Route::None {
+ if route == Route::None {
+ return Ok(response);
+ } else {
let redo = if response.headers.get_raw("x-ratelimit-global").is_some() {
let _ = GLOBAL.lock().expect("global route lock poisoned");
@@ -402,8 +404,6 @@ pub fn perform<'a, F>(route: Route, f: F) -> Result<Response>
if !redo.unwrap_or(true) {
return Ok(response);
}
- } else {
- return Ok(response);
}
}
}