mirror of
https://github.com/danbulant/icon
synced 2026-05-24 12:22:13 +00:00
simply symlink handling
This commit is contained in:
parent
05b48b3b91
commit
49f93a9c3e
1 changed files with 3 additions and 2 deletions
|
|
@ -146,7 +146,9 @@ impl IconSearch<Initial> {
|
||||||
.flatten() // merge all the iterators
|
.flatten() // merge all the iterators
|
||||||
.flatten() // remove Err entries
|
.flatten() // remove Err entries
|
||||||
.filter_map(|entry| Some((entry.file_type().ok()?, entry))) // get file type for each entry and skip if fail
|
.filter_map(|entry| Some((entry.file_type().ok()?, entry))) // get file type for each entry and skip if fail
|
||||||
.partition::<Vec<_>, _>(|(ft, _)| ft.is_dir());
|
.partition::<Vec<_>, _>(|(ft, entry)| {
|
||||||
|
ft.is_dir() || (!entry.path().extension().is_some() && ft.is_symlink())
|
||||||
|
});
|
||||||
|
|
||||||
// icons at the top-level in a base_dir don't belong to a theme, but must still be able to be found!
|
// icons at the top-level in a base_dir don't belong to a theme, but must still be able to be found!
|
||||||
let files = files
|
let files = files
|
||||||
|
|
@ -564,5 +566,4 @@ mod test {
|
||||||
let icon = locations.standalone_icon("htop").unwrap();
|
let icon = locations.standalone_icon("htop").unwrap();
|
||||||
assert_eq!(icon.path.file_name(), Some("htop.png".as_ref()))
|
assert_eq!(icon.path.file_name(), Some("htop.png".as_ref()))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue