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 +++--- src/model/channel/mod.rs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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); } } } diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index 98e5f8d..b82b22c 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -177,9 +177,8 @@ impl Channel { #[inline] pub fn is_nsfw(&self) -> bool { match *self { - Channel::Group(_) => false, Channel::Guild(ref channel) => channel.read().unwrap().is_nsfw(), - Channel::Private(_) => false, + Channel::Group(_) | Channel::Private(_) => false, } } -- cgit v1.2.3