From d3b094aad90b5387b79de01b83ba5f1d7e766705 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Wed, 14 Jun 2017 19:37:37 -0700 Subject: Run clippy on examples --- examples/05_command_framework/src/main.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'examples/05_command_framework/src') 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: -- cgit v1.2.3