From d48aeda6b2ba1af019e66b182ca45a59047b33c0 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Mon, 23 Sep 2019 20:23:11 +0200 Subject: [PATCH] Apply clippy suggestions --- src/internal/filter/size.rs | 8 ++++---- src/walk.rs | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/internal/filter/size.rs b/src/internal/filter/size.rs index dcf0e32..895169e 100644 --- a/src/internal/filter/size.rs +++ b/src/internal/filter/size.rs @@ -37,13 +37,13 @@ impl SizeFilter { let multiplier = match &captures.get(3).map_or("b", |m| m.as_str()).to_lowercase()[..] { v if v.starts_with("ki") => KIBI, - v if v.starts_with("k") => KILO, + v if v.starts_with('k') => KILO, v if v.starts_with("mi") => MEBI, - v if v.starts_with("m") => MEGA, + v if v.starts_with('m') => MEGA, v if v.starts_with("gi") => GIBI, - v if v.starts_with("g") => GIGA, + v if v.starts_with('g') => GIGA, v if v.starts_with("ti") => TEBI, - v if v.starts_with("t") => TERA, + v if v.starts_with('t') => TERA, "b" => 1, _ => return None, }; diff --git a/src/walk.rs b/src/walk.rs index 9a44c8d..df25666 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -328,14 +328,9 @@ fn spawn_senders( .map(|m| fshelper::is_executable(&m)) .unwrap_or(false)) || (file_types.empty_only && !fshelper::is_empty(&entry)) + || !(entry_type.is_file() || entry_type.is_dir() || entry_type.is_symlink()) { return ignore::WalkState::Continue; - } else if !(entry_type.is_file() - || entry_type.is_dir() - || entry_type.is_symlink()) - { - // This is probably a block device, char device, fifo or socket. Skip it. - return ignore::WalkState::Continue; } } else { return ignore::WalkState::Continue;