Fix clippy pedantic lints

This commit is contained in:
Aadi Desai 2023-12-08 16:42:31 +00:00
parent 2217d65201
commit 9ade860388
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
3 changed files with 15 additions and 13 deletions

View file

@ -1,6 +1,7 @@
use crate::{db, ACtx, Error, Gaijin};
use poise::serenity_prelude as serenity;
use poise::Modal;
use std::fmt::Write;
/// Get the number of entries in the gaijin table
#[tracing::instrument(skip_all)]
@ -117,10 +118,10 @@ pub(crate) async fn get_gaijin_by_name(ctx: ACtx<'_>, name: String) -> Result<()
} else {
ctx.say(format!(
"Possible matches for {name}: {}",
gaijin
.iter()
.map(|g| format!(" <@{}>", g.discord_id))
.collect::<String>()
gaijin.iter().fold(String::new(), |mut s, g| {
write!(s, " <@{}>", g.discord_id).expect("String write! is infallible");
s
})
))
.await?;
}

View file

@ -1,5 +1,6 @@
use crate::{db, ACtx, Error};
use poise::serenity_prelude as serenity;
use std::fmt::Write;
/// Unreachable, used to create whois command folder
#[allow(clippy::unused_async)]
@ -55,10 +56,10 @@ pub(crate) async fn whois_by_nickname(ctx: ACtx<'_>, nickname: String) -> Result
ctx.send(|c| {
c.ephemeral(true).content(format!(
"Possible matches for {nickname}: {}",
members
.iter()
.map(|m| format!(" <@{}>", m.discord_id))
.collect::<String>()
members.iter().fold(String::new(), |mut s, g| {
write!(s, " <@{}>", g.discord_id).expect("String write! is infallible");
s
})
))
})
.await?;
@ -90,10 +91,10 @@ pub(crate) async fn whois_by_realname(ctx: ACtx<'_>, realname: String) -> Result
ctx.send(|c| {
c.ephemeral(true).content(format!(
"Possible matches for {realname}: {}",
members
.iter()
.map(|m| format!(" <@{}>", m.discord_id))
.collect::<String>()
members.iter().fold(String::new(), |mut s, g| {
write!(s, " <@{}>", g.discord_id).expect("String write! is infallible");
s
})
))
})
.await?;

View file

@ -41,7 +41,7 @@ pub(crate) async fn verify(
)
.await
{
Ok(_) => {
Ok(()) => {
tracing::info!(
"ID {} added: {}, {}",
id,