From 768bc1549f6c319ace71c535fad898fca221fb51 Mon Sep 17 00:00:00 2001 From: Agatha Date: Thu, 9 Apr 2020 22:07:17 +0300 Subject: [PATCH] Replace '!= None' with '.is_some()' --- src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2f86c7a..891db6e 100755 --- a/src/main.rs +++ b/src/main.rs @@ -210,7 +210,7 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { let _ = message.channel_id.send_message(&ctx.http, |m| { m.embed(|e| { // Set embed author unless empty - if input_embed.author != None { + if input_embed.author.is_some() { let auth = input_embed.author.unwrap(); e.author(|a| { //assuming first array element is name and second is icon url @@ -230,16 +230,16 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { } // Set embed description unless empty - if input_embed.description != None { + if input_embed.description.is_some() { e.description(input_embed.description.unwrap()); } // Set embed fields unless empty - if input_embed.fields != None { + if input_embed.fields.is_some() { e.fields(input_embed.fields.unwrap()); } // Set embed footer unless empty - if input_embed.footer != None { + if input_embed.footer.is_some() { let foot = input_embed.footer.unwrap(); e.footer(|f| { //assuming first array element is name and second is icon url @@ -250,19 +250,19 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { }); } - if input_embed.image != None { + if input_embed.image.is_some() { e.image(input_embed.image.unwrap()); } - if input_embed.timestamp != None { + if input_embed.timestamp.is_some() { e.timestamp(input_embed.timestamp.unwrap()); } - if input_embed.title != None { + if input_embed.title.is_some() { e.title(input_embed.title.unwrap()); } - if input_embed.url != None { + if input_embed.url.is_some() { e.url(input_embed.url.unwrap()); }