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 = let matcher =
fuzzy_matcher::skim::SkimMatcherV2::default(); fuzzy_matcher::skim::SkimMatcherV2::default();
let mut files = let mut files = self
self.files.iter().enumerate().filter_map(|a| { .files
.iter()
.enumerate()
.filter_map(|a| {
a.1.path.to_str().and_then(|path| { a.1.path.to_str().and_then(|path| {
matcher matcher.fuzzy_indices(path, q).map(
.fuzzy_indices(path, q) |(score, indices)| (score, a.0, indices),
.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; self.selection = 0;