Use StringMatchCandidate::new to construct candidates more conveniently
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
1e96fc98e7
commit
bd2527e691
4 changed files with 25 additions and 19 deletions
|
@ -45,16 +45,8 @@ impl<T> Outline<T> {
|
|||
.map(|range| &item.text[range.start as usize..range.end as usize])
|
||||
.collect::<String>();
|
||||
|
||||
path_candidates.push(StringMatchCandidate {
|
||||
id,
|
||||
char_bag: path_text.as_str().into(),
|
||||
string: path_text.clone(),
|
||||
});
|
||||
candidates.push(StringMatchCandidate {
|
||||
id,
|
||||
char_bag: candidate_text.as_str().into(),
|
||||
string: candidate_text,
|
||||
});
|
||||
path_candidates.push(StringMatchCandidate::new(id, path_text.clone()));
|
||||
candidates.push(StringMatchCandidate::new(id, candidate_text));
|
||||
}
|
||||
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue