diff options
| author | Zeyla Hellyer <[email protected]> | 2017-04-19 16:37:34 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-04-19 16:37:34 -0700 |
| commit | 5bf6c2d2cf0491951eddb10ab2641d02d0e730a1 (patch) | |
| tree | a15ea368b419607d6b38523eb18bc618b99fc884 /src | |
| parent | Clippy lints (diff) | |
| download | serenity-5bf6c2d2cf0491951eddb10ab2641d02d0e730a1.tar.xz serenity-5bf6c2d2cf0491951eddb10ab2641d02d0e730a1.zip | |
Fix ratelimiting on `Route::None` routes
Routes with a `Route::None` - to indicate not to keep a ratelimit
bucket - would enter a loop on the route. To fix this, add an `else`
block to the check for whether the route is _not_ `Route::None`, and
return from it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/rest/ratelimiting.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/rest/ratelimiting.rs b/src/client/rest/ratelimiting.rs index d336e37..cb88476 100644 --- a/src/client/rest/ratelimiting.rs +++ b/src/client/rest/ratelimiting.rs @@ -402,6 +402,8 @@ pub fn perform<'a, F>(route: Route, f: F) -> Result<Response> if !redo.unwrap_or(true) { return Ok(response); } + } else { + return Ok(response); } } } |