mirror of
https://github.com/supleed2/nanobot.git
synced 2024-12-22 14:15:51 +00:00
Fix clippy pedantic lints
This commit is contained in:
parent
2217d65201
commit
9ade860388
|
@ -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?;
|
||||
}
|
||||
|
|
|
@ -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?;
|
||||
|
|
|
@ -41,7 +41,7 @@ pub(crate) async fn verify(
|
|||
)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
Ok(()) => {
|
||||
tracing::info!(
|
||||
"ID {} added: {}, {}",
|
||||
id,
|
||||
|
|
Loading…
Reference in a new issue