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