diff options
author | Conrad Ludgate <conradludgate@gmail.com> | 2021-02-14 18:00:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 18:00:41 +0000 |
commit | bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 (patch) | |
tree | d0c85ade3768dc9b04f6d94c9d9b5c360a17c257 /src/main.rs | |
parent | 72c5ea79147f7bd486839cfeb4aab62a98a0bdd2 (diff) |
a few more tiny touch ups (#7)
* a few more tiny touch ups
* all praise clippy
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/main.rs b/src/main.rs index 2dbeabfe..21241b83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,6 @@ use std::path::PathBuf; use directories::ProjectDirs; use eyre::{eyre, Result}; use structopt::StructOpt; -use uuid::Uuid; #[macro_use] extern crate log; @@ -46,26 +45,17 @@ impl Atuin { let path = shellexpand::full(path)?; PathBuf::from(path.as_ref()) } else { - let project_dirs = - ProjectDirs::from("com", "elliehuxtable", "atuin").ok_or_else(|| { + ProjectDirs::from("com", "elliehuxtable", "atuin") + .ok_or_else(|| { eyre!("could not determine db file location\nspecify one using the --db flag") - })?; - let root = project_dirs.data_dir(); - root.join("history.db") + })? + .data_dir() + .join("history.db") }; let mut db = Sqlite::new(db_path)?; - match self.atuin { - AtuinCmd::History(history) => history.run(&mut db), - AtuinCmd::Import(import) => import.run(&mut db), - AtuinCmd::Server(server) => server.run(), - - AtuinCmd::Uuid => { - println!("{}", Uuid::new_v4().to_simple().to_string()); - Ok(()) - } - } + self.atuin.run(&mut db) } } |