summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgarlic-hub <12842269+garlic-hub@users.noreply.github.com>2024-03-08 10:46:24 -0800
committergarlic-hub <12842269+garlic-hub@users.noreply.github.com>2024-03-08 10:46:24 -0800
commit0788c43c3fcd61f0d3a3807d250563739d6ed371 (patch)
treef62fc247bfd87e4b1509dc3866ce65de359d9db3
parent3b2fd158b5ef4ba5f8cccddc2d2efb1de24b6c47 (diff)
Clean up clippy warnings
-rw-r--r--src/dir_entry.rs2
-rw-r--r--src/exec/token.rs2
-rw-r--r--src/regex_helper.rs2
-rw-r--r--src/walk.rs6
4 files changed, 6 insertions, 6 deletions
diff --git a/src/dir_entry.rs b/src/dir_entry.rs
index f44f2be..64d7adf 100644
--- a/src/dir_entry.rs
+++ b/src/dir_entry.rs
@@ -113,7 +113,7 @@ impl Eq for DirEntry {}
impl PartialOrd for DirEntry {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
- self.path().partial_cmp(other.path())
+ Some(self.cmp(other))
}
}
diff --git a/src/exec/token.rs b/src/exec/token.rs
index 2dc37ce..b96c3a3 100644
--- a/src/exec/token.rs
+++ b/src/exec/token.rs
@@ -41,7 +41,7 @@ pub(super) fn tokenize(input: &str) -> ArgumentTemplate {
let mut remaining = input;
let mut buf = String::new();
let placeholders = PLACEHOLDERS.get_or_init(|| {
- AhoCorasick::new(&["{{", "}}", "{}", "{/}", "{//}", "{.}", "{/.}"]).unwrap()
+ AhoCorasick::new(["{{", "}}", "{}", "{/}", "{//}", "{.}", "{/.}"]).unwrap()
});
while let Some(m) = placeholders.find(remaining) {
match m.pattern().as_u32() {
diff --git a/src/regex_helper.rs b/src/regex_helper.rs
index 98211fe..39878f5 100644
--- a/src/regex_helper.rs
+++ b/src/regex_helper.rs
@@ -16,7 +16,7 @@ fn hir_has_uppercase_char(hir: &Hir) -> bool {
use regex_syntax::hir::*;
match hir.kind() {
- HirKind::Literal(Literal(bytes)) => match std::str::from_utf8(&bytes) {
+ HirKind::Literal(Literal(bytes)) => match std::str::from_utf8(bytes) {
Ok(s) => s.chars().any(|c| c.is_uppercase()),
Err(_) => bytes.iter().any(|b| char::from(*b).is_uppercase()),
},
diff --git a/src/walk.rs b/src/walk.rs
index c81d2a4..6f83365 100644
--- a/src/walk.rs
+++ b/src/walk.rs
@@ -250,7 +250,7 @@ impl<'a, W: Write> ReceiverBuffer<'a, W> {
/// Output a path.
fn print(&mut self, entry: &DirEntry) -> Result<(), ExitCode> {
- output::print_entry(&mut self.stdout, entry, &self.config);
+ output::print_entry(&mut self.stdout, entry, self.config);
if self.interrupt_flag.load(Ordering::Relaxed) {
// Ignore any errors on flush, because we're about to exit anyway
@@ -413,7 +413,7 @@ impl WorkerState {
// This will be set to `Some` if the `--exec` argument was supplied.
if let Some(ref cmd) = config.command {
if cmd.in_batch_mode() {
- exec::batch(rx.into_iter().flatten(), cmd, &config)
+ exec::batch(rx.into_iter().flatten(), cmd, config)
} else {
let out_perm = Mutex::new(());
@@ -426,7 +426,7 @@ impl WorkerState {
// Spawn a job thread that will listen for and execute inputs.
let handle = scope
- .spawn(|| exec::job(rx.into_iter().flatten(), cmd, &out_perm, &config));
+ .spawn(|| exec::job(rx.into_iter().flatten(), cmd, &out_perm, config));
// Push the handle of the spawned thread into the vector for later joining.
handles.push(handle);