Apply manual clippy

This commit is contained in:
Natsu Kagami 2024-08-04 22:42:44 +02:00
parent b9f6fa7fb8
commit 6458454ba9
Signed by: nki
GPG key ID: 55A032EB38B49ADB
4 changed files with 58 additions and 60 deletions

View file

@ -8,7 +8,7 @@ use serenity::{
},
model::channel::{Channel, Message},
};
use std::string::ToString;
use std::fmt::Display;
use youmubot_prelude::*;
#[command]
@ -108,8 +108,7 @@ async fn get_image(
let req = client
.get(format!(
"https://danbooru.donmai.us/posts.json?tags=rating:{}+{}",
rating.to_string(),
tags
rating, tags
))
.query(&[("limit", "50"), ("random", "true")])
.build()?;
@ -133,13 +132,12 @@ enum Rating {
Safe,
}
impl ToString for Rating {
fn to_string(&self) -> String {
impl Display for Rating {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use Rating::*;
match self {
f.write_str(match self {
Explicit => "explicit",
Safe => "safe",
}
.to_owned()
})
}
}