mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 09:10: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
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue