diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/ratelimiting.rs | 6 | ||||
| -rw-r--r-- | src/model/channel/mod.rs | 3 |
2 files changed, 4 insertions, 5 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); } } } 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, } } |