mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 17:08:21 +00:00
cargo fmt
This commit is contained in:
parent
638d7c2648
commit
c3dbce1cd6
1 changed files with 16 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue