cargo fmt

This commit is contained in:
extrawurst 2022-04-24 20:12:47 +02:00
parent 638d7c2648
commit c3dbce1cd6

View file

@ -88,18 +88,26 @@ impl FileFindPopup {
let matcher =
fuzzy_matcher::skim::SkimMatcherV2::default();
let mut files =
self.files.iter().enumerate().filter_map(|a| {
let mut files = self
.files
.iter()
.enumerate()
.filter_map(|a| {
a.1.path.to_str().and_then(|path| {
matcher
.fuzzy_indices(path, q)
.map(|(score, indices)| (score, a.0, indices))
matcher.fuzzy_indices(path, q).map(
|(score, indices)| (score, a.0, indices),
)
})
}).collect::<Vec<(_, _, _)>>();
})
.collect::<Vec<(_, _, _)>>();
files.sort_by(|(score1, _, _), (score2, _, _)| score2.cmp(score1));
files.sort_by(|(score1, _, _), (score2, _, _)| {
score2.cmp(score1)
});
self.files_filtered.extend(files.into_iter().map(|entry| (entry.1, entry.2)));
self.files_filtered.extend(
files.into_iter().map(|entry| (entry.1, entry.2)),
);
}
self.selection = 0;