diff --git a/src/client.rs b/src/client.rs index b3b6a6f..be7af13 100644 --- a/src/client.rs +++ b/src/client.rs @@ -29,7 +29,7 @@ pub fn execute(args: Vec) { fn draw_screentime(date: NaiveDate) { let config = Config::get_screentime_file_path(); - let db = DB::open(&config).unwrap(); + let db = DB::open(config).unwrap(); let tx = db.tx(false).unwrap(); let bucket = tx.get_bucket("screentime").unwrap(); let screentime = if let Some(data) = bucket.get(&date.to_string()) { diff --git a/src/main.rs b/src/main.rs index a9510c4..daa866b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,13 +15,13 @@ type ScreenTime = HashMap; fn build_router() -> Router { Router::new() - .route("/inlinehms", get(&api::get_inlinehms)) - .route("/json", get(&api::get_json_secs)) + .route("/inlinehms", get(api::get_inlinehms)) + .route("/json", get(api::get_json_secs)) } #[tokio::main] async fn main() { - if std::env::args().nth(1).unwrap_or("missing".into()) != "-d".to_string() { + if std::env::args().nth(1).unwrap_or("missing".into()) != *"-d" { client::execute(std::env::args().skip(1).collect()); return; } diff --git a/src/utils.rs b/src/utils.rs index c85a824..a624f3e 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -30,7 +30,7 @@ pub fn get_focused_program_name() -> String { let title = window.title; if title.to_lowercase().starts_with("vim") || title.to_lowercase().starts_with("nvim") { - title.split(" ").nth(0).unwrap().to_string() + title.split(' ').next().unwrap().to_string() } else { process_name.into_string().unwrap() }