cargo updates

This commit is contained in:
Robin Appelman 2026-11-13 00:14:45 +01:00
commit 3aef9e288c
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
5 changed files with 498 additions and 857 deletions

View file

@ -4,7 +4,7 @@ use crate::raw::RawLog;
pub use crate::raw::{
ChatMessage, ClassNumbers, Event, KillStreak, Player, RoundPlayer, Teams, Uploader,
};
use chrono::{DateTime, NaiveDateTime, Utc};
use chrono::{DateTime, Utc};
use serde::Deserialize;
use std::cmp::Ordering;
use std::collections::HashMap;
@ -91,9 +91,7 @@ impl Info {
}
pub fn date(&self) -> DateTime<Utc> {
NaiveDateTime::from_timestamp_opt(self.date as i64, 0)
.unwrap()
.and_utc()
DateTime::from_timestamp(self.date as i64, 0).unwrap()
}
}
@ -256,7 +254,7 @@ fn get_round_end_time(round: &Round) -> u32 {
Event::RoundWin { time, .. } => Some(*time),
_ => None,
})
.last()
.next_back()
.unwrap_or_default()
}
@ -265,7 +263,7 @@ fn get_first_event_time(round: &Round) -> u32 {
.events
.iter()
.map(|event| event.time())
.last()
.next_back()
.unwrap_or_default()
}
@ -277,7 +275,7 @@ fn get_round_point_capped(round: &Round) -> u8 {
Event::PointCap { point, .. } => Some(*point),
_ => None,
})
.last()
.next_back()
.unwrap_or_default()
}
@ -307,7 +305,7 @@ fn get_last_cap_time(round: &Round) -> u32 {
Event::PointCap { time, .. } => Some(*time),
_ => None,
})
.last()
.next_back()
.unwrap_or_default()
}