From f90c01f702f6a98b041f766b6a1d857bc1b9afef Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Mon, 11 Sep 2023 09:26:05 +0100 Subject: replace chrono with time (#806) * replace chrono with time * Fix test chrono usage --------- Co-authored-by: Ellie Huxtable --- atuin-client/src/import/zsh_histdb.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'atuin-client/src/import/zsh_histdb.rs') diff --git a/atuin-client/src/import/zsh_histdb.rs b/atuin-client/src/import/zsh_histdb.rs index 78a7176b..37c70814 100644 --- a/atuin-client/src/import/zsh_histdb.rs +++ b/atuin-client/src/import/zsh_histdb.rs @@ -35,10 +35,10 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; -use chrono::{prelude::*, Utc}; use directories::UserDirs; use eyre::{eyre, Result}; use sqlx::{sqlite::SqlitePool, Pool}; +use time::PrimitiveDateTime; use super::Importer; use crate::history::History; @@ -52,7 +52,7 @@ pub struct HistDbEntryCount { #[derive(sqlx::FromRow, Debug)] pub struct HistDbEntry { pub id: i64, - pub start_time: NaiveDateTime, + pub start_time: PrimitiveDateTime, pub host: Vec, pub dir: Vec, pub argv: Vec, @@ -62,7 +62,7 @@ pub struct HistDbEntry { impl From for History { fn from(histdb_item: HistDbEntry) -> Self { let imported = History::import() - .timestamp(DateTime::from_utc(histdb_item.start_time, Utc)) + .timestamp(histdb_item.start_time.assume_utc()) .command( String::from_utf8(histdb_item.argv) .unwrap_or_else(|_e| String::from("")) -- cgit v1.3.1