mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
Further simplify the code
This commit is contained in:
parent
8cea65c1b8
commit
82e6562cfc
1 changed files with 5 additions and 6 deletions
|
@ -61,15 +61,14 @@ impl TryFrom<WorkerResult> for PathBuf {
|
||||||
WorkerResult::Error(ignore_error) => {
|
WorkerResult::Error(ignore_error) => {
|
||||||
if let ignore::Error::WithPath { path, err } = &ignore_error {
|
if let ignore::Error::WithPath { path, err } = &ignore_error {
|
||||||
if let ignore::Error::Io(ref io_err) = **err {
|
if let ignore::Error::Io(ref io_err) = **err {
|
||||||
if io_err.kind() == io::ErrorKind::NotFound {
|
if io_err.kind() == io::ErrorKind::NotFound
|
||||||
if let Ok(metadata) = fs::symlink_metadata(&path) {
|
&& fs::symlink_metadata(&path)
|
||||||
if metadata.file_type().is_symlink() {
|
.map_or(false, |m| m.file_type().is_symlink())
|
||||||
|
{
|
||||||
return Ok(path.to_path_buf());
|
return Ok(path.to_path_buf());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return Err(ignore_error);
|
return Err(ignore_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue