Skip to content

Commit

Permalink
Use chrono::NaiveDateTime::from_timestamp_opt instead of `chrono::N…
Browse files Browse the repository at this point in the history
…aiveDateTime::from_timestamp`
  • Loading branch information
Steffo99 committed May 12, 2023
1 parent 574d1a2 commit bf1d948
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async fn match_announce(current_match_id: &mut i64, client: &webhook::client::We
trace!("Ensuring the end date time exists...");
let end = match_.end_date_time.ok_or_else(|| RefreshError::Data)?;
let end = i64::try_from(end).map_err(|_| RefreshError::Data)?;
let end = chrono::NaiveDateTime::from_timestamp(end, 0);
let end = chrono::NaiveDateTime::from_timestamp_opt(end, 0).expect("timestamp to be valid");
let end = chrono::DateTime::<chrono::Utc>::from_utc(end, chrono::Utc);

trace!("Determining duration string...");
Expand Down

0 comments on commit bf1d948

Please sign in to comment.