Skip to content
Myr

Simplify match statement

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 9d73402 · Browse files · 1 file+4 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−8 removed

  • other:+4 added−8 removed

1 file+4 added−8 removed

modified:src/walk.rs+4 added-8 removed
56 unmodified lines
5758 fn try_from(worker_result: WorkerResult) -> Result<PathBuf, Self::Error> {59 match worker_result {60 WorkerResult::Entry(value) => return Ok(value),61 WorkerResult::Error(err) => {62 if let ignore::Error::WithPath {63 path,64 err: path_err,65 } = &err66 {67 if let ignore::Error::Io(io_err) = &**path_err {61 WorkerResult::Error(ignore_error) => {62 if let ignore::Error::WithPath { path, err } = &ignore_error {63 if let ignore::Error::Io(ref io_err) = **err {64 if io_err.kind() == io::ErrorKind::NotFound {65 if let Ok(metadata) = fs::symlink_metadata(&path) {66 if metadata.file_type().is_symlink() {67 return Ok(path.to_path_buf());
1 unmodified line
69 }70 }71 }72 }77 return Err(err);73 return Err(ignore_error);74 }75 }76 }77}
343 unmodified lines