aboutsummaryrefslogtreecommitdiff
path: root/examples/05_command_framework/src
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-06-14 19:37:37 -0700
committerZeyla Hellyer <[email protected]>2017-06-14 19:37:37 -0700
commitd3b094aad90b5387b79de01b83ba5f1d7e766705 (patch)
tree71c8444b0d57e0ec4b531d380eb042d64d0cd5c6 /examples/05_command_framework/src
parentReset shard handling on reconnects (diff)
downloadserenity-d3b094aad90b5387b79de01b83ba5f1d7e766705.tar.xz
serenity-d3b094aad90b5387b79de01b83ba5f1d7e766705.zip
Run clippy on examples
Diffstat (limited to 'examples/05_command_framework/src')
-rw-r--r--examples/05_command_framework/src/main.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/05_command_framework/src/main.rs b/examples/05_command_framework/src/main.rs
index 4d5ead4..2f7d57c 100644
--- a/examples/05_command_framework/src/main.rs
+++ b/examples/05_command_framework/src/main.rs
@@ -95,12 +95,8 @@ fn main() {
// reason or another. For example, when a user has exceeded a rate-limit or a command
// can only be performed by the bot owner.
.on_dispatch_error(|_ctx, msg, error| {
- match error {
- DispatchError::RateLimited(seconds) => {
- let _ = msg.channel_id.say(&format!("Try this again in {} seconds.", seconds));
- },
- // Any other error would be silently ignored.
- _ => {},
+ if let DispatchError::RateLimited(seconds) = error {
+ let _ = msg.channel_id.say(&format!("Try this again in {} seconds.", seconds));
}
})
// Can't be used more than once per 5 seconds: