From 660edfefed7e658ed73ef64cd20582e390bb0cc5 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 14 Feb 2021 15:15:26 +0000 Subject: Make pedantic clippy happy --- src/command/history.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/command/history.rs') 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), } } } -- cgit v1.3.1