One round of cargo clippy

This commit is contained in:
Natsu Kagami 2024-02-18 01:06:23 +01:00 committed by Natsu Kagami
parent 4bdab3cefb
commit 4a1853532a
6 changed files with 9 additions and 14 deletions

View file

@ -12,7 +12,7 @@ fn unwrap_or_ref<'a, T: ?Sized, B: Borrow<T>>(opt: &'a Option<B>, default: &'a T
}
/// Create an embed representing the user.
pub fn user_embed<'a>(user: &User) -> CreateEmbed {
pub fn user_embed(user: &User) -> CreateEmbed {
let rank = unwrap_or_ref(&user.rank, "Unranked").to_title_case();
let max_rank = unwrap_or_ref(&user.max_rank, "Unranked").to_title_case();
let rating = user.rating.unwrap_or(1500);
@ -60,7 +60,7 @@ pub fn user_embed<'a>(user: &User) -> CreateEmbed {
}
/// Gets an embed of the Rating Change.
pub fn rating_change_embed<'a>(
pub fn rating_change_embed(
rating_change: &RatingChange,
user: &User,
contest: &Contest,

View file

@ -152,7 +152,7 @@ fn parse<'a>(
matches
}
fn print_info_message<'a>(info: &[(ContestOrProblem, &str)]) -> CreateEmbed {
fn print_info_message(info: &[(ContestOrProblem, &str)]) -> CreateEmbed {
let (problems, contests): (Vec<_>, Vec<_>) = info.iter().partition(|(v, _)| match v {
ContestOrProblem::Problem(_) => true,
ContestOrProblem::Contest(_, _) => false,