fix(filesystem-device-match): make behavior of ignoring filesystem errors more explicit

This commit is contained in:
2025-11-01 18:51:07 -04:00
parent a998832f6b
commit d1fd13163f

View File

@@ -138,14 +138,11 @@ pub fn extract(
let mut filesystem = FileSystem::new(filesystem);
// Check the metadata of the item.
let metadata = filesystem.metadata(Path::new(&want_item));
// Ignore filesystem errors as we can't do anything useful with the error.
if metadata.is_err() {
let Some(metadata) = filesystem.metadata(Path::new(&want_item)).ok() else {
continue;
}
};
let metadata = metadata?;
// Only check directories and files.
if !(metadata.is_directory() || metadata.is_regular_file()) {
continue;