changeset 52168:6b7ffa3f9199

rust-changelog: switch away from deprecated APIs for datetime use This was caught by clippy, nothing was changed aside from some light API changes.
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 19 Jun 2024 18:20:22 +0200
parents 7346f93be7a4
children 84b5802ba7d3
files rust/hg-core/src/revlog/changelog.rs
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/changelog.rs	Wed Jun 19 19:10:49 2024 +0200
+++ b/rust/hg-core/src/revlog/changelog.rs	Wed Jun 19 18:20:22 2024 +0200
@@ -366,10 +366,7 @@
     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