mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-19 02:10:34 +01:00
Fix --type: skip if file type is unknown
This commit is contained in:
parent
1ec204caa8
commit
e38b7d7bff
1 changed files with 3 additions and 3 deletions
|
@ -161,17 +161,17 @@ pub fn scan(root: &Path, pattern: Arc<Regex>, config: Arc<FdOptions>) {
|
||||||
match config.file_type {
|
match config.file_type {
|
||||||
FileType::Any => (),
|
FileType::Any => (),
|
||||||
FileType::RegularFile => {
|
FileType::RegularFile => {
|
||||||
if entry.file_type().map_or(false, |ft| !ft.is_file()) {
|
if entry.file_type().map_or(true, |ft| !ft.is_file()) {
|
||||||
return ignore::WalkState::Continue;
|
return ignore::WalkState::Continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileType::Directory => {
|
FileType::Directory => {
|
||||||
if entry.file_type().map_or(false, |ft| !ft.is_dir()) {
|
if entry.file_type().map_or(true, |ft| !ft.is_dir()) {
|
||||||
return ignore::WalkState::Continue;
|
return ignore::WalkState::Continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileType::SymLink => {
|
FileType::SymLink => {
|
||||||
if entry.file_type().map_or(false, |ft| !ft.is_symlink()) {
|
if entry.file_type().map_or(true, |ft| !ft.is_symlink()) {
|
||||||
return ignore::WalkState::Continue;
|
return ignore::WalkState::Continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue