From 48074cd2006c8c59839bd9dd4a3c5e240f8b2676 Mon Sep 17 00:00:00 2001 From: Agatha Rose Date: Mon, 27 Jul 2020 20:03:41 +0300 Subject: [PATCH] Make clippy happy --- src/commands/brainfuck.rs | 2 +- src/commands/lyrics.rs | 2 +- src/main.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/commands/brainfuck.rs b/src/commands/brainfuck.rs index dc3b442..fc45723 100644 --- a/src/commands/brainfuck.rs +++ b/src/commands/brainfuck.rs @@ -14,7 +14,7 @@ fn brainfuck(ctx: &mut Context, message: &Message, args: Args) -> CommandResult "" => { return Err(CommandError(s!("Called without input!"))); } - v @ _ => v, + v => v, }; let output = Brainfuck::execute(input); diff --git a/src/commands/lyrics.rs b/src/commands/lyrics.rs index 9a4eb48..f35714f 100644 --- a/src/commands/lyrics.rs +++ b/src/commands/lyrics.rs @@ -27,7 +27,7 @@ fn lyrics(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { "" => { return Err(CommandError(s!("Called without input!"))); } - v @ _ => v, + v => v, }; // encode into url url += &s!(percent_encode(input.as_bytes(), NON_ALPHANUMERIC)); diff --git a/src/main.rs b/src/main.rs index ed939a1..6ab2ef1 100755 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ #![allow(clippy::unreadable_literal)] +#![allow(clippy::cmp_owned)] #[macro_use] extern crate lazy_static; @@ -479,7 +480,7 @@ fn owo(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { Err(_) => return Err(CommandError(s!("Could not get last message!"))), }; - let ref lastmsg = lastmsg[0].content; + let lastmsg = &lastmsg[0].content; let input: String = match args.is_empty() { true => s!(lastmsg), @@ -508,7 +509,7 @@ fn desc(ctx: &mut Context, message: &Message) -> CommandResult { }; let channel = channel_lock.read(); - let topic = if channel.topic.clone().unwrap() != String::from("") { + let topic = if channel.topic.clone().unwrap() != "" { channel.topic.clone().unwrap() } else { String::from("No channel topic found")