mirror of
https://codeberg.org/icewind/log-normalizer.git
synced 2026-11-30 02:20:47 +01:00
cargo updates
This commit is contained in:
parent
383e3b929e
commit
3aef9e288c
5 changed files with 498 additions and 857 deletions
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue