Skip to content

Commit

Permalink
Merge pull request #1510 from garlic-hub/clippy
Browse files Browse the repository at this point in the history
Clean up clippy warnings
  • Loading branch information
tavianator committed Mar 8, 2024
2 parents 3b2fd15 + 0788c43 commit 4efc05e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dir_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/exec/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/regex_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
},
Expand Down
6 changes: 3 additions & 3 deletions src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(());

Expand All @@ -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);
Expand Down

0 comments on commit 4efc05e

Please sign in to comment.