mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-13 07:31:09 +01:00
Clean up clippy warnings
This commit is contained in:
parent
3b2fd158b5
commit
0788c43c3f
4 changed files with 6 additions and 6 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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()),
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue