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/nu.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'atuin-client/src/import/nu.rs') diff --git a/atuin-client/src/import/nu.rs b/atuin-client/src/import/nu.rs index 46600325..1131fac5 100644 --- a/atuin-client/src/import/nu.rs +++ b/atuin-client/src/import/nu.rs @@ -6,6 +6,7 @@ use std::{fs::File, io::Read, path::PathBuf}; use async_trait::async_trait; use directories::BaseDirs; use eyre::{eyre, Result}; +use time::OffsetDateTime; use super::{unix_byte_lines, Importer, Loader}; use crate::history::History; @@ -44,7 +45,7 @@ impl Importer for Nu { } async fn load(self, h: &mut impl Loader) -> Result<()> { - let now = chrono::Utc::now(); + let now = OffsetDateTime::now_utc(); let mut counter = 0; for b in unix_byte_lines(&self.bytes) { @@ -55,7 +56,7 @@ impl Importer for Nu { let cmd: String = s.replace("<\\n>", "\n"); - let offset = chrono::Duration::nanoseconds(counter); + let offset = time::Duration::nanoseconds(counter); counter += 1; let entry = History::import().timestamp(now - offset).command(cmd); -- cgit v1.3.1