aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/history.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2021-02-14 17:18:02 +0000
committerGitHub <noreply@github.com>2021-02-14 17:18:02 +0000
commit72c5ea79147f7bd486839cfeb4aab62a98a0bdd2 (patch)
treeb9bfffc47dc3a8ad457bb8bd414a215eea26504e /src/command/history.rs
parentNeaten the history listing code (#5) (diff)
downloadatuin-72c5ea79147f7bd486839cfeb4aab62a98a0bdd2.zip
tidy some stuff (#6)
Diffstat (limited to 'src/command/history.rs')
-rw-r--r--src/command/history.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/command/history.rs b/src/command/history.rs
index 5959fc55..e40af4d6 100644
--- a/src/command/history.rs
+++ b/src/command/history.rs
@@ -34,7 +34,7 @@ pub enum Cmd {
},
}
-fn print_list(h: &Vec<History>) {
+fn print_list(h: &[History]) {
for i in h {
println!("{}", i.command);
}
@@ -60,7 +60,7 @@ impl Cmd {
// print the ID
// we use this as the key for calling end
println!("{}", h.id);
- db.save(h)?;
+ db.save(&h)?;
Ok(())
}
@@ -69,7 +69,7 @@ impl Cmd {
h.exit = *exit;
h.duration = chrono::Utc::now().timestamp_nanos() - h.timestamp;
- db.update(h)?;
+ db.update(&h)?;
Ok(())
}