From d77567074f318aa926d93bc23dded9a632ce88dc Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:24:47 +0000 Subject: [PATCH] more clippy lints --- src/player.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/player.rs b/src/player.rs index c77bf81..807d12e 100644 --- a/src/player.rs +++ b/src/player.rs @@ -57,14 +57,12 @@ pub struct Player { impl Player { async fn add_metadata(mut self, db: &mut MySqlConnection) -> Player { - match get_player_notes(db, self.id).await { - Some(notes) => self.notes = notes, - None => (), + if let Some(notes) = get_player_notes(db, self.id).await { + self.notes = notes } - match get_player_jobbans(db, self.id).await { - Some(jobbans) => self.job_bans = jobbans, - None => (), + if let Some(jobbans) = get_player_jobbans(db, self.id).await { + self.job_bans = jobbans } if self.is_permabanned.is_some() && self.is_permabanned.unwrap() != 0 { @@ -332,7 +330,7 @@ pub async fn get_recent_playtime( days: i64, ) -> Json> { let time_since = chrono::Utc - .with_ymd_and_hms(2000, 01, 01, 00, 00, 00) + .with_ymd_and_hms(2000, 1, 1, 0, 0, 0) .unwrap() .timestamp_millis();