Replace match on true/false with if in spoile.rs::spoiler

This commit is contained in:
charlotte ✨ 2021-07-07 12:25:51 +01:00
parent aecdc7a273
commit f89eb2842c
1 changed files with 5 additions and 5 deletions

View File

@ -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