# HG changeset patch # User Raphaël Gomès # Date 2024-06-19 16:20:22 # Node ID 6b7ffa3f9199fab91e57d2f6425d2a28f45b4682 # Parent 7346f93be7a4e814accbedb7f33f5e75a039b0c2 rust-changelog: switch away from deprecated APIs for datetime use This was caught by clippy, nothing was changed aside from some light API changes. diff --git a/rust/hg-core/src/revlog/changelog.rs b/rust/hg-core/src/revlog/changelog.rs --- a/rust/hg-core/src/revlog/changelog.rs +++ b/rust/hg-core/src/revlog/changelog.rs @@ -366,10 +366,7 @@ fn parse_timestamp( let timezone = FixedOffset::west_opt(timezone_secs) .ok_or_else(|| HgError::corrupted("timezone offset out of bounds"))?; - Ok(DateTime::from_naive_utc_and_offset( - timestamp_utc.naive_utc(), - timezone, - )) + Ok(timestamp_utc.with_timezone(&timezone)) } /// Attempt to parse the given string as floating-point timestamp, and