From 4077c33adfdacaf0ed68657a1955a7b69a78d373 Mon Sep 17 00:00:00 2001 From: Vlad Stepanov <8uk.8ak@gmail.com> Date: Thu, 15 Jun 2023 14:29:40 +0400 Subject: Builder interface for History objects (#933) * [feature] store env variables in History records WIP: remove `HistoryWithoutDelete`, add some docstrings, tests * Create History objects through builders. Assure in compile-time that all required fields are set for the given construction scenario * (from #882) split Cmd::run into subfns * Update `History` doc * remove rmp-serde from history * update warning --------- Co-authored-by: Conrad Ludgate --- atuin-client/src/import/bash.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'atuin-client/src/import/bash.rs') diff --git a/atuin-client/src/import/bash.rs b/atuin-client/src/import/bash.rs index 9901c1f3..25ede053 100644 --- a/atuin-client/src/import/bash.rs +++ b/atuin-client/src/import/bash.rs @@ -80,17 +80,9 @@ impl Importer for Bash { next_timestamp = t; } LineType::Command(c) => { - let entry = History::new( - next_timestamp, - c.into(), - "unknown".into(), - -1, - -1, - None, - None, - None, - ); - h.push(entry).await?; + let imported = History::import().timestamp(next_timestamp).command(c); + + h.push(imported.build().into()).await?; next_timestamp += timestamp_increment; } } -- cgit v1.3.1