From 540aea32af7878293c72fe9cc2c2d3ce27a44c5e Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Tue, 23 May 2017 22:42:41 -0700 Subject: Clippy lints --- src/http/ratelimiting.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/http') 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 // 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 if !redo.unwrap_or(true) { return Ok(response); } - } else { - return Ok(response); } } } -- cgit v1.2.3