Closed panekj closed 1 week ago
Replacing entry
with path
and call to fs::metadata
should fix the issue
(Opened PR as well since I needed to use patch)
diff --git a/src/iter.rs b/src/iter.rs
index 9ff853a..880a88c 100644
--- a/src/iter.rs
+++ b/src/iter.rs
@@ -51,10 +51,10 @@ impl Iterator for Iter {
Err(_) => continue 'inner,
};
- if let Ok(file_type) = entry.file_type() {
- if file_type.is_dir() {
+ if let Ok(metadata) = path.metadata() {
+ if metadata.is_dir() {
self.directories_to_walk.push(path);
- } else if file_type.is_file()
+ } else if metadata.is_file()
&& path.extension().map_or(false, |ext| ext == "desktop")
{
self.actively_walking = Some(iterator);
Commit https://github.com/pop-os/freedesktop-desktop-entry/commit/4ae8d55468fea45aac43f22e977d6b21b7d7cd81 that fixed https://github.com/pop-os/freedesktop-desktop-entry/issues/1 broke finding symlinks, specifically this change:
This is because it was changed to path being canonicalized
but we are obtaining a file type of
entry: DirEntry
, notpath: PathBuf
so the file type will remain a symlink and
is_file()
/is_dir()
/is_symlink()
are all mutually exclusive.