From 85273f32e8d156eacd987f7015d65d8aecd8d5f9 Mon Sep 17 00:00:00 2001 From: Seren Kwok Date: Sun, 10 Mar 2024 12:12:51 +0000 Subject: [PATCH] cruft --- crates/cli/src/updater.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/cli/src/updater.rs b/crates/cli/src/updater.rs index c16c7a1d1..48f1a65e9 100644 --- a/crates/cli/src/updater.rs +++ b/crates/cli/src/updater.rs @@ -1,6 +1,6 @@ use anyhow::bail; use anyhow::{Context, Result}; -use chrono::NaiveDateTime; +use chrono::{DateTime, NaiveDateTime, Utc}; use colored::Colorize; use log::info; use marzano_auth::info::AuthInfo; @@ -622,7 +622,7 @@ impl Updater { } /// Get the release date of the app, based on the release ID - fn _get_app_release_date(&self, app_name: SupportedApp) -> Result { + fn _get_app_release_date(&self, app_name: SupportedApp) -> Result> { let app_manifest = self._get_app_manifest(app_name)?; let version_string = app_manifest .version @@ -632,7 +632,7 @@ impl Updater { // The date is the last part let timestamp = version_string.last().context("Missing timestamp")?; // Convert the unix timestamp to a date - let date = NaiveDateTime::from_timestamp_millis(timestamp.parse::()?) + let date = DateTime::from_timestamp_millis(timestamp.parse::()?) .context("Could not parse timestamp")?; Ok(date) } @@ -785,10 +785,10 @@ mod tests { let cli_release_date = updater._get_app_release_date(SupportedApp::Cli)?; assert_eq!( cli_release_date, - NaiveDate::from_ymd_opt(2023, 7, 12) + DateTime::::from_naive_utc_and_offset(NaiveDate::from_ymd_opt(2023, 7, 12) .unwrap() .and_hms_opt(5, 2, 9) - .unwrap() + .unwrap(), Utc), ); Ok(())