Skip to content

Commit

Permalink
Removing use of deprecated methods from 'chrono' crate
Browse files Browse the repository at this point in the history
  • Loading branch information
detro committed May 20, 2024
1 parent bc00cdc commit bba1115
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 2 additions & 5 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ pub(crate) fn parse_chrono_datetime_utc(
) -> Result<chrono::DateTime<chrono::Utc>, KonsumerOffsetsError> {
let millis = parse_i64(parser)?;

Ok(chrono::DateTime::<chrono::Utc>::from_utc(
chrono::NaiveDateTime::from_timestamp_millis(millis)
.ok_or(KonsumerOffsetsError::ChronoDateTimeUtcParsingError(millis))?,
chrono::Utc,
))
chrono::DateTime::<chrono::Utc>::from_timestamp_millis(millis)
.ok_or(KonsumerOffsetsError::ChronoDateTimeUtcParsingError(millis))
}

/// Wraps the result of [`parse_i64`] into a [`time::OffsetDateTime`].
Expand Down

0 comments on commit bba1115

Please sign in to comment.