aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/import/fish.rs
diff options
context:
space:
mode:
authorVlad Stepanov <8uk.8ak@gmail.com>2023-06-15 14:29:40 +0400
committerGitHub <noreply@github.com>2023-06-15 10:29:40 +0000
commit4077c33adfdacaf0ed68657a1955a7b69a78d373 (patch)
tree432d5c23992388a6c1bd4b11d41785ea00d56905 /atuin-client/src/import/fish.rs
parentAdd namespaces to kv store (#1052) (diff)
downloadatuin-4077c33adfdacaf0ed68657a1955a7b69a78d373.zip
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 <conrad.ludgate@truelayer.com>
Diffstat (limited to 'atuin-client/src/import/fish.rs')
-rw-r--r--atuin-client/src/import/fish.rs28
1 files changed, 4 insertions, 24 deletions
diff --git a/atuin-client/src/import/fish.rs b/atuin-client/src/import/fish.rs
index e54ca730..90ecabc3 100644
--- a/atuin-client/src/import/fish.rs
+++ b/atuin-client/src/import/fish.rs
@@ -73,19 +73,9 @@ impl Importer for Fish {
// first, we must deal with the prev cmd
if let Some(cmd) = cmd.take() {
let time = time.unwrap_or(now);
+ let entry = History::import().timestamp(time).command(cmd);
- loader
- .push(History::new(
- time,
- cmd,
- "unknown".into(),
- -1,
- -1,
- None,
- None,
- None,
- ))
- .await?;
+ loader.push(entry.build().into()).await?;
}
// using raw strings to avoid needing escaping.
@@ -109,19 +99,9 @@ impl Importer for Fish {
// we might have a trailing cmd
if let Some(cmd) = cmd.take() {
let time = time.unwrap_or(now);
+ let entry = History::import().timestamp(time).command(cmd);
- loader
- .push(History::new(
- time,
- cmd,
- "unknown".into(),
- -1,
- -1,
- None,
- None,
- None,
- ))
- .await?;
+ loader.push(entry.build().into()).await?;
}
Ok(())