mirror of
https://github.com/uutils/findutils.git
synced 2026-06-10 15:48:30 -07:00
find,xargs: fix clippy::items_after_statements
This commit is contained in:
+7
-7
@@ -528,6 +528,13 @@ fn path_exists(path: &Path, follow_symlinks: bool) -> bool {
|
||||
}
|
||||
|
||||
fn match_entry(entry: &CStr, config: &Config, patterns: &Patterns) -> bool {
|
||||
// glob metacharacters in a stored path aren't handled yet, so such entries are skipped. On
|
||||
// Windows `\` is the path separator (present in every path), so it must not count here.
|
||||
#[cfg(windows)]
|
||||
const GLOB_METACHARS: &str = "*?[]";
|
||||
#[cfg(not(windows))]
|
||||
const GLOB_METACHARS: &str = r"*?[]\";
|
||||
|
||||
let buf = bytes_to_path(entry.to_bytes());
|
||||
let name = if config.basename {
|
||||
let Some(path) = buf.file_name() else {
|
||||
@@ -552,13 +559,6 @@ fn match_entry(entry: &CStr, config: &Config, patterns: &Patterns) -> bool {
|
||||
};
|
||||
let entry = name.to_string_lossy();
|
||||
|
||||
// glob metacharacters in a stored path aren't handled yet, so such entries are skipped. On
|
||||
// Windows `\` is the path separator (present in every path), so it must not count here.
|
||||
#[cfg(windows)]
|
||||
const GLOB_METACHARS: &str = "*?[]";
|
||||
#[cfg(not(windows))]
|
||||
const GLOB_METACHARS: &str = r"*?[]\";
|
||||
|
||||
let has_metachars = entry.chars().any(|c| GLOB_METACHARS.contains(c));
|
||||
let patterns_match = if config.all {
|
||||
if has_metachars {
|
||||
|
||||
+5
-5
@@ -514,17 +514,17 @@ where
|
||||
R: Read,
|
||||
{
|
||||
fn next(&mut self) -> io::Result<Option<Argument>> {
|
||||
enum Escape {
|
||||
Slash,
|
||||
Quote(u8),
|
||||
}
|
||||
|
||||
let mut result = vec![];
|
||||
let mut terminated_by_newline = false;
|
||||
|
||||
let mut pending = vec![];
|
||||
std::mem::swap(&mut pending, &mut self.pending);
|
||||
|
||||
enum Escape {
|
||||
Slash,
|
||||
Quote(u8),
|
||||
}
|
||||
|
||||
let mut escape: Option<Escape> = None;
|
||||
let mut i = 0;
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user