diff --git a/youmubot-osu/src/discord/announcer.rs b/youmubot-osu/src/discord/announcer.rs index 683609b..fbb2eec 100644 --- a/youmubot-osu/src/discord/announcer.rs +++ b/youmubot-osu/src/discord/announcer.rs @@ -76,7 +76,7 @@ impl youmubot_prelude::Announcer for Announcer { Ok(v) => { osu_user.pp = v .iter() - .map(|u| u.pp.clone()) + .map(|u| u.pp) .collect::>() .try_into() .unwrap(); diff --git a/youmubot-osu/src/discord/db.rs b/youmubot-osu/src/discord/db.rs index 9cf38a0..c205ec3 100644 --- a/youmubot-osu/src/discord/db.rs +++ b/youmubot-osu/src/discord/db.rs @@ -170,7 +170,7 @@ impl From for OsuUser { user_id: UserId(u.user_id as u64), username: u .username - .map(|v| Cow::Owned(v)) + .map(Cow::Owned) .unwrap_or("unknown".into()), id: u.id as u64, last_update: u.last_update, diff --git a/youmubot-osu/src/discord/mod.rs b/youmubot-osu/src/discord/mod.rs index 35b13bf..65684a1 100644 --- a/youmubot-osu/src/discord/mod.rs +++ b/youmubot-osu/src/discord/mod.rs @@ -199,7 +199,7 @@ pub async fn save(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult } Ok(None) } - let (score, mode) = match find_score(&osu, &u).await? { + let (score, mode) = match find_score(osu, &u).await? { Some(v) => v, None => { msg.reply( @@ -245,7 +245,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 = CollectReaction::new(&ctx) + let user_reaction = CollectReaction::new(ctx) .message_id(reply.id.0) .author_id(msg.author.id.0) .filter(move |r| r.emoji == emoji) @@ -253,7 +253,7 @@ pub async fn save(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult .collect_limit(1) .await; if let Some(ur) = user_reaction { - if check(&osu, &u, score.beatmap_id).await? { + if check(osu, &u, score.beatmap_id).await? { break true; } if let ReactionAction::Added(ur) = &*ur { diff --git a/youmubot-osu/src/models/mods.rs b/youmubot-osu/src/models/mods.rs index 0f1de0d..f20013a 100644 --- a/youmubot-osu/src/models/mods.rs +++ b/youmubot-osu/src/models/mods.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; -const LAZER_TEXT: &'static str = "v2"; +const LAZER_TEXT: &str = "v2"; bitflags::bitflags! { /// The mods available to osu! diff --git a/youmubot-osu/src/models/rosu.rs b/youmubot-osu/src/models/rosu.rs index 4c84bbe..92f7b2c 100644 --- a/youmubot-osu/src/models/rosu.rs +++ b/youmubot-osu/src/models/rosu.rs @@ -45,7 +45,7 @@ impl Beatmap { beatmapset_id: set.mapset_id as u64, creator: set.creator_name.clone().into_string(), creator_id: set.creator_id as u64, - source: Some(set.source.clone()).filter(|s| s != "").clone(), + source: Some(set.source.clone()).filter(|s| !s.is_empty()).clone(), genre: set.genre.map(|v| v.into()).unwrap_or(Genre::Unspecified), language: set.language.map(|v| v.into()).unwrap_or(Language::Any), tags: set.tags.split(", ").map(|v| v.to_owned()).collect(),