Skip to content

Commit

Permalink
enable clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chadaustin committed Dec 23, 2024
1 parent 31eb23e commit 556c2e3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
4 changes: 1 addition & 3 deletions src/cmd/benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::len_zero)]

use crate::cmd::index;
use anyhow::anyhow;
use chrono::DateTime;
Expand Down Expand Up @@ -168,7 +166,7 @@ impl JwalkParStat {
cb = path_tx.send_vec(cb).unwrap();
}
}
if cb.len() > 0 {
if !cb.is_empty() {
path_tx.send_vec(cb).unwrap();
}
});
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::let_unit_value)]

use clap::Subcommand;

mod benchmark;
Expand Down
5 changes: 0 additions & 5 deletions src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ impl Database {
fn conn(&self) -> &Connection {
self.0.borrow_owner()
}

#[allow(unused)]
fn conn_mut(&mut self) -> &Connection {
self.0.borrow_owner()
}
}

impl Database {
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// TODO: fix
#![allow(dead_code)]

pub mod database;
pub mod hash;
pub mod iopool;
Expand Down
9 changes: 3 additions & 6 deletions src/scan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![allow(clippy::len_zero)]
#![allow(clippy::redundant_pattern_matching)]

use crate::model::FileInfo;
use crate::model::IMPath;
use anyhow::Context;
Expand Down Expand Up @@ -160,7 +157,7 @@ fn jwalk_scan(
if paths.is_empty() {
return;
}
if let Err(_) = tx
let Ok(()) = tx
.send_iter(paths.into_iter().map(|(p, result)| match result {
Ok(()) => {
let metadata = std::fs::symlink_metadata(&p)
Expand All @@ -171,10 +168,10 @@ fn jwalk_scan(
Err(e) => (p, Err(e)),
}))
.await
{
else {
// Receiver dropped; we can early-exit.
return;
}
};
}
});
}
Expand Down

0 comments on commit 556c2e3

Please sign in to comment.