mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
One round of cargo clippy
This commit is contained in:
parent
4bdab3cefb
commit
4a1853532a
6 changed files with 9 additions and 14 deletions
|
@ -144,12 +144,7 @@ fn beatmap_title(
|
|||
.build()
|
||||
}
|
||||
|
||||
pub fn beatmap_embed<'a>(
|
||||
b: &'_ Beatmap,
|
||||
m: Mode,
|
||||
mods: Mods,
|
||||
info: BeatmapInfoWithPP,
|
||||
) -> CreateEmbed {
|
||||
pub fn beatmap_embed(b: &'_ Beatmap, m: Mode, mods: Mods, info: BeatmapInfoWithPP) -> CreateEmbed {
|
||||
let diff = b.difficulty.apply_mods(mods, info.0.stars);
|
||||
CreateEmbed::new()
|
||||
.title(beatmap_title(&b.artist, &b.title, &b.difficulty_name, mods))
|
||||
|
@ -178,7 +173,7 @@ pub fn beatmap_embed<'a>(
|
|||
|
||||
const MAX_DIFFS: usize = 25 - 4;
|
||||
|
||||
pub fn beatmapset_embed<'a>(bs: &'_ [Beatmap], m: Option<Mode>) -> CreateEmbed {
|
||||
pub fn beatmapset_embed(bs: &'_ [Beatmap], m: Option<Mode>) -> CreateEmbed {
|
||||
let too_many_diffs = bs.len() > MAX_DIFFS;
|
||||
let b: &Beatmap = &bs[0];
|
||||
let mut m = CreateEmbed::new()
|
||||
|
@ -266,7 +261,7 @@ pub(crate) fn score_embed<'a>(
|
|||
|
||||
impl<'a> ScoreEmbedBuilder<'a> {
|
||||
#[allow(clippy::many_single_char_names)]
|
||||
pub fn build<'b>(&mut self) -> CreateEmbed {
|
||||
pub fn build(&mut self) -> CreateEmbed {
|
||||
let mode = self.bm.mode();
|
||||
let b = &self.bm.0;
|
||||
let s = self.s;
|
||||
|
|
|
@ -246,7 +246,7 @@ pub async fn save(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult
|
|||
let reaction = reply.react(&ctx, '👌').await?;
|
||||
let completed = loop {
|
||||
let emoji = reaction.emoji.clone();
|
||||
let user_reaction = collector::ReactionCollector::new(&ctx)
|
||||
let user_reaction = collector::ReactionCollector::new(ctx)
|
||||
.message_id(reply.id)
|
||||
.author_id(msg.author.id)
|
||||
.filter(move |r| r.emoji == emoji)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue