mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-18 01:40:34 +01:00
save one indent level in error handling for add_ignore
This commit is contained in:
parent
74e593c43c
commit
6aa87f3423
1 changed files with 12 additions and 13 deletions
25
src/walk.rs
25
src/walk.rs
|
@ -84,20 +84,19 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) {
|
|||
|
||||
for ignore_file in &config.ignore_files {
|
||||
let result = walker.add_ignore(ignore_file);
|
||||
if let Some(err) = result {
|
||||
match err {
|
||||
ignore::Error::Partial(_) => (),
|
||||
_ => {
|
||||
print_error!(
|
||||
"{}",
|
||||
format!(
|
||||
"Malformed pattern in custom ignore file '{}': {}.",
|
||||
ignore_file.to_string_lossy(),
|
||||
err.description()
|
||||
)
|
||||
);
|
||||
}
|
||||
match result {
|
||||
Some(ignore::Error::Partial(_)) => (),
|
||||
Some(err) => {
|
||||
print_error!(
|
||||
"{}",
|
||||
format!(
|
||||
"Malformed pattern in custom ignore file '{}': {}.",
|
||||
ignore_file.to_string_lossy(),
|
||||
err.description()
|
||||
)
|
||||
);
|
||||
}
|
||||
None => (),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue