Skip to content

Commit

Permalink
cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
seren5240 committed Mar 10, 2024
1 parent 4a0fc36 commit 85273f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/cli/src/updater.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<NaiveDateTime> {
fn _get_app_release_date(&self, app_name: SupportedApp) -> Result<DateTime<Utc>> {
let app_manifest = self._get_app_manifest(app_name)?;
let version_string = app_manifest
.version
Expand All @@ -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::<i64>()?)
let date = DateTime::from_timestamp_millis(timestamp.parse::<i64>()?)
.context("Could not parse timestamp")?;
Ok(date)
}
Expand Down Expand Up @@ -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::<Utc>::from_naive_utc_and_offset(NaiveDate::from_ymd_opt(2023, 7, 12)
.unwrap()
.and_hms_opt(5, 2, 9)
.unwrap()
.unwrap(), Utc),
);

Ok(())
Expand Down

0 comments on commit 85273f3

Please sign in to comment.