diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2023-09-11 09:26:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 09:26:05 +0100 |
| commit | f90c01f702f6a98b041f766b6a1d857bc1b9afef (patch) | |
| tree | 04a4755bd632abdcf398d0ce903163ed60a5a212 /atuin-client/src/import/zsh_histdb.rs | |
| parent | Use `case` for Linux distro choice in `install.sh` (#1200) (diff) | |
| download | atuin-f90c01f702f6a98b041f766b6a1d857bc1b9afef.zip | |
replace chrono with time (#806)
* replace chrono with time
* Fix test chrono usage
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-client/src/import/zsh_histdb.rs')
| -rw-r--r-- | atuin-client/src/import/zsh_histdb.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<u8>, pub dir: Vec<u8>, pub argv: Vec<u8>, @@ -62,7 +62,7 @@ pub struct HistDbEntry { impl From<HistDbEntry> 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("")) |
