0
0
mirror of https://github.com/TeFiLeDo/tree-owners.git synced 2024-11-12 22:36:17 +01:00

rethink abort conditions

This commit is contained in:
Adrian Wannenmacher 2023-09-24 14:49:18 +02:00
parent 5b0a00d140
commit 8736e99c3a
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5

View File

@ -38,19 +38,19 @@ fn fs_entry(entry: &Path, summary: &mut Summary) {
let display = entry.display();
if !entry.exists() && !entry.is_symlink() {
print_root_err(format!("{display} doesn't exist"));
return;
}
let meta = match entry.symlink_metadata() {
Ok(meta) => meta,
match entry.symlink_metadata() {
Ok(meta) => {
summary.add_user(meta.st_uid());
summary.add_group(meta.st_gid());
}
Err(e) => {
print_err(e, format!("failed to get metadata for {display}"));
return;
}
};
summary.add_user(meta.st_uid());
summary.add_group(meta.st_gid());
if entry.is_dir() {
let children = match read_dir(entry) {
Ok(children) => children,
@ -63,10 +63,7 @@ fn fs_entry(entry: &Path, summary: &mut Summary) {
for child in children {
match child {
Ok(child) => fs_entry(&child.path(), summary),
Err(e) => {
print_err(e, format!("invalid child for {display}"));
return;
}
Err(e) => print_err(e, format!("invalid child for {display}")),
}
}
}