diff --git a/src/main.rs b/src/main.rs index e074fcc..2a62330 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,11 +61,10 @@ impl Display for ScanError { #[cfg(windows)] fn is_hidden(entry: &DirEntry) -> bool { use std::os::windows::prelude::*; - use std::fs; - fs::metadata(entry) // try to get metadata for file + std::fs::metadata(entry) // try to get metadata for file .map_or( false, // if getting metadata/attributes fails, assume it's not hidden - |f| f.file_attributes() & 0x2 // flag for hidden - https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants + |f| f.file_attributes() & 0x2 > 0 // flag for hidden - https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants ) }