From bba111574e4126279c647409e16f31464c851e6d Mon Sep 17 00:00:00 2001 From: Ivan De Marino Date: Mon, 20 May 2024 09:16:08 +0100 Subject: [PATCH] Removing use of deprecated methods from 'chrono' crate --- CHANGELOG.md | 2 ++ src/utils.rs | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db79e6b..69ff007 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Notes * Deps upgrade +* Removing unnecessary `[registries.crates-io] protocol = sparse` Cargo config +* Tweaking use of `chrono` to remove use of deprecated methods # v0.3.0 (2023-06-30) diff --git a/src/utils.rs b/src/utils.rs index 33b3d28..00ccdd6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -79,11 +79,8 @@ pub(crate) fn parse_chrono_datetime_utc( ) -> Result, KonsumerOffsetsError> { let millis = parse_i64(parser)?; - Ok(chrono::DateTime::::from_utc( - chrono::NaiveDateTime::from_timestamp_millis(millis) - .ok_or(KonsumerOffsetsError::ChronoDateTimeUtcParsingError(millis))?, - chrono::Utc, - )) + chrono::DateTime::::from_timestamp_millis(millis) + .ok_or(KonsumerOffsetsError::ChronoDateTimeUtcParsingError(millis)) } /// Wraps the result of [`parse_i64`] into a [`time::OffsetDateTime`].