diff --git a/Cargo.lock b/Cargo.lock index b626e75..529c57d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1194,7 +1194,7 @@ dependencies = [ [[package]] name = "rustcord" -version = "0.2.6" +version = "0.2.7" dependencies = [ "owoify 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 1f7240d..4902b13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustcord" -version = "0.2.6" +version = "0.2.7" authors = ["Agatha "] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 6fc62e9..7dcdb5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,7 +135,7 @@ fn list_srv(ctx: &mut Context, message: &Message) -> CommandResult { } let _ = message.channel_id.say( &ctx.http, - list.replace("@everyone", "@\u{200B}everyone").to_string(), + list.replace("@everyone", "@\u{200B}everyone"), ); Ok(()) @@ -399,15 +399,15 @@ fn compare_bot(ctx: &mut Context, message: &Message, mut args: Args) -> CommandR #[aliases("what's this")] fn what(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { let text: String = args.rest().trim().to_string(); - let defs = &urbandict::get_definitions(&text.to_string()); + let defs = &urbandict::get_definitions(&text); match defs { Err(_e) => { let _ = message .channel_id - .say(&ctx.http, format!("Invalid query >w<")); + .say(&ctx.http, "Invalid query >w<".to_string()); } Ok(v) => { - if v.len() > 0 { + if !v.is_empty() { let def = &v[0]; let _ = message.channel_id.send_message(&ctx.http, |m| { m.embed(|e| {