From ba17924962894ddab37c46b07789fb0d3422de7b Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Thu, 5 Sep 2024 10:57:15 +0200 Subject: [PATCH] build: Update chrono to 0.4.38 (#3990) --- Cargo.lock | 6 +++--- relay-common/src/time.rs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02799217dc..39cc4f43ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -614,15 +614,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] diff --git a/relay-common/src/time.rs b/relay-common/src/time.rs index 3a170fd007..a82899ab3f 100644 --- a/relay-common/src/time.rs +++ b/relay-common/src/time.rs @@ -3,7 +3,7 @@ use std::fmt; use std::time::{Duration, Instant, SystemTime}; -use chrono::{DateTime, NaiveDateTime, TimeZone, Utc}; +use chrono::{DateTime, TimeZone, Utc}; use serde::{Deserialize, Serialize}; /// Converts an `Instant` into a `SystemTime`. @@ -116,8 +116,7 @@ impl UnixTimestamp { /// Returns the timestamp as chrono datetime. pub fn as_datetime(self) -> Option> { - NaiveDateTime::from_timestamp_opt(self.0 as i64, 0) - .map(|n| DateTime::from_naive_utc_and_offset(n, Utc)) + DateTime::from_timestamp(self.0 as i64, 0) } }