From f89eb2842c2e77ae64f91fde3beb89c5378e43b3 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Wed, 7 Jul 2021 12:25:51 +0100 Subject: [PATCH] Replace match on true/false with if in spoile.rs::spoiler --- src/commands/spoile.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commands/spoile.rs b/src/commands/spoile.rs index c1b41dd..e00eda1 100644 --- a/src/commands/spoile.rs +++ b/src/commands/spoile.rs @@ -10,11 +10,11 @@ use serenity::{ #[command] async fn spoiler(ctx: &Context, message: &Message, args: Args) -> CommandResult { // check if the message has any attachments - let attachments = match message.attachments.is_empty() { - true => { - return Err("No images were attached!".into()); - } - false => &message.attachments, + + let attachments = if message.attachments.is_empty() { + return Err("No images were attached!".into()); + } else { + &message.attachments }; // get the author's nick in the server, otherwise default to global username later