mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 17:10:17 +00:00
fix(filesystem-device-match): make behavior of ignoring filesystem errors more explicit
This commit is contained in:
@@ -138,14 +138,11 @@ pub fn extract(
|
|||||||
let mut filesystem = FileSystem::new(filesystem);
|
let mut filesystem = FileSystem::new(filesystem);
|
||||||
|
|
||||||
// Check the metadata of the item.
|
// 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.
|
// 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;
|
continue;
|
||||||
}
|
};
|
||||||
|
|
||||||
let metadata = metadata?;
|
|
||||||
// Only check directories and files.
|
// Only check directories and files.
|
||||||
if !(metadata.is_directory() || metadata.is_regular_file()) {
|
if !(metadata.is_directory() || metadata.is_regular_file()) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user