Skip to content

Commit

Permalink
cargo clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Czajka committed Mar 18, 2024
1 parent 2122d59 commit 354da7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn execute(args: Vec<String>) {

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()) {
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ type ScreenTime = HashMap<String, u32>;

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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 354da7f

Please # to comment.