When fuzzle builds its cache based on .desktop files, it assumes that each data directory listed by xdg has an applications subdirectory.
This is not always the case and when it's not fuzzle panics. This is the code responsible for the panic.
pub fn build_cache() -> Vec<SearchResult> {
let mut results: Vec<SearchResult> = Vec::new();
// Build SearchResults for all desktop files we can find
for mut data_dir in search_dirs() {
data_dir.push("applications"); // <--- here you push applications
results.append(
&mut fs::read_dir(data_dir)
.expect("Can't find data dir")
.filter_map(|path| searchresult_from_desktopentry(&path.unwrap().path()))
.collect(),
);
}
// ...
}
After you append applications to each data dir path I would check if the resulting directory exists before you try to read its entries.
When
fuzzle
builds its cache based on.desktop
files, it assumes that each data directory listed byxdg
has anapplications
subdirectory.This is not always the case and when it's not
fuzzle
panics. This is the code responsible for the panic.After you append
applications
to each data dir path I would check if the resulting directory exists before you try to read its entries.