1
0
mirror of https://github.com/jht5945/finding.git synced 2025-12-27 13:20:03 +08:00

fix clippy

This commit is contained in:
2020-04-28 00:39:17 +08:00
parent 93d39ecd50
commit 39b6cbde6a

View File

@@ -157,11 +157,9 @@ fn find_text_files(options: &Options, dir_path: &Path) {
let p_str = match p.to_str() {
Some(s) => s, None => return,
};
if !file_exts.is_empty() {
if !file_exts.iter().any(|file_ext| p_str.to_lowercase().ends_with(file_ext)) {
if !file_exts.is_empty() && !file_exts.iter().any(|file_ext| p_str.to_lowercase().ends_with(file_ext)) {
return;
}
}
if !options.filter_file_name.is_empty() && !p_str.contains(options.filter_file_name.as_str()) {
return;
}