aboutsummaryrefslogtreecommitdiff
path: root/src/commands/meme/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/meme/mod.rs')
-rw-r--r--src/commands/meme/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/commands/meme/mod.rs b/src/commands/meme/mod.rs
index fe69b1c..c40e80a 100644
--- a/src/commands/meme/mod.rs
+++ b/src/commands/meme/mod.rs
@@ -74,7 +74,7 @@ async fn send_meme(
msg: &Message,
) -> CommandResult {
let should_tts =
- t.content.as_ref().map(|t| t.len() > 0).unwrap_or(false) && random::<u32>() % 25 == 0;
+ t.content.as_ref().map(|t| !t.is_empty()).unwrap_or(false) && random::<u32>() % 25 == 0;
debug!("sending meme (tts: {}): {:?}", should_tts, t);
@@ -85,7 +85,7 @@ async fn send_meme(
let ret = CreateMessage::default().tts(should_tts);
match t.content {
- Some(ref text) if text.len() > 0 => ret.content(text),
+ Some(ref text) if !text.is_empty() => ret.content(text),
_ => ret,
}
};
@@ -98,11 +98,10 @@ async fn send_meme(
msg.channel_id.send_files(ctx, vec![att], cmsg).await?;
},
- None => match t.content {
- Some(_) => {
+ None => {
+ if t.content.is_some() {
msg.channel_id.send_message(ctx, cmsg).await?;
- },
- None => {},
+ }
},
};