Make clippy happy

This commit is contained in:
Agatha Lovelace 2020-07-27 20:03:41 +03:00
parent 42ff74e0be
commit b2e169fb0b
No known key found for this signature in database
GPG Key ID: 2DB18BA2E0A80BC3
3 changed files with 5 additions and 4 deletions

View File

@ -14,7 +14,7 @@ fn brainfuck(ctx: &mut Context, message: &Message, args: Args) -> CommandResult
"" => { "" => {
return Err(CommandError(s!("Called without input!"))); return Err(CommandError(s!("Called without input!")));
} }
v @ _ => v, v => v,
}; };
let output = Brainfuck::execute(input); let output = Brainfuck::execute(input);

View File

@ -27,7 +27,7 @@ fn lyrics(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
"" => { "" => {
return Err(CommandError(s!("Called without input!"))); return Err(CommandError(s!("Called without input!")));
} }
v @ _ => v, v => v,
}; };
// encode into url // encode into url
url += &s!(percent_encode(input.as_bytes(), NON_ALPHANUMERIC)); url += &s!(percent_encode(input.as_bytes(), NON_ALPHANUMERIC));

View File

@ -1,4 +1,5 @@
#![allow(clippy::unreadable_literal)] #![allow(clippy::unreadable_literal)]
#![allow(clippy::cmp_owned)]
#[macro_use] #[macro_use]
extern crate lazy_static; 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!"))), 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() { let input: String = match args.is_empty() {
true => s!(lastmsg), true => s!(lastmsg),
@ -508,7 +509,7 @@ fn desc(ctx: &mut Context, message: &Message) -> CommandResult {
}; };
let channel = channel_lock.read(); 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() channel.topic.clone().unwrap()
} else { } else {
String::from("No channel topic found") String::from("No channel topic found")