diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-02-14 15:15:26 +0000 |
|---|---|---|
| committer | Ellie Huxtable <e@elm.sh> | 2021-02-14 15:35:08 +0000 |
| commit | 660edfefed7e658ed73ef64cd20582e390bb0cc5 (patch) | |
| tree | 39dde592e4ce6361eb69ff3cc402176caaf4dbe3 /src/command/history.rs | |
| parent | Make clippy annoying asf + add server (diff) | |
| download | atuin-660edfefed7e658ed73ef64cd20582e390bb0cc5.zip | |
Make pedantic clippy happy
Diffstat (limited to 'src/command/history.rs')
| -rw-r--r-- | src/command/history.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/command/history.rs b/src/command/history.rs index f8a5b27e..73be66fa 100644 --- a/src/command/history.rs +++ b/src/command/history.rs @@ -3,11 +3,11 @@ use std::env; use eyre::Result; use structopt::StructOpt; -use crate::local::database::{Database, SqliteDatabase}; +use crate::local::database::{Database, Sqlite}; use crate::local::history::History; #[derive(StructOpt)] -pub enum HistoryCmd { +pub enum Cmd { #[structopt( about="begins a new command in the history", aliases=&["s", "st", "sta", "star"], @@ -34,10 +34,10 @@ pub enum HistoryCmd { }, } -impl HistoryCmd { - pub fn run(&self, db: &mut SqliteDatabase) -> Result<()> { +impl Cmd { + pub fn run(&self, db: &mut Sqlite) -> Result<()> { match self { - HistoryCmd::Start { command: words } => { + Self::Start { command: words } => { let command = words.join(" "); let cwd = env::current_dir()?.display().to_string(); @@ -58,7 +58,7 @@ impl HistoryCmd { Ok(()) } - HistoryCmd::End { id, exit } => { + Self::End { id, exit } => { let mut h = db.load(id)?; h.exit = *exit; h.duration = chrono::Utc::now().timestamp_nanos() - h.timestamp; @@ -68,7 +68,7 @@ impl HistoryCmd { Ok(()) } - HistoryCmd::List { distinct } => db.list(*distinct), + Self::List { distinct } => db.list(*distinct), } } } |
