Fix clippy lint without changing pattern

This commit is contained in:
Zanie 2023-07-15 09:00:15 -05:00
parent d898ffaf7a
commit c9b305e9ca

View file

@ -329,12 +329,11 @@ pub fn python_files_in_path(
}
}
let should_include = result.as_ref().map_or(true, |entry| {
if result.as_ref().map_or(true, |entry| {
// Ignore directories
if entry.file_type().map_or(true, |ft| ft.is_dir()) {
return false;
}
if entry.depth() == 0 {
false
} else if entry.depth() == 0 {
// Accept all files that are passed-in directly.
true
} else {
@ -352,8 +351,7 @@ pub fn python_files_in_path(
false
}
}
});
if should_include {
}) {
files.lock().unwrap().push(result);
}