Improve StringMatchCandidate::new interface (#22011)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2024-12-14 13:35:36 -07:00
committed by GitHub
parent 9daa426e93
commit 25970650a7
28 changed files with 92 additions and 184 deletions
+2 -2
View File
@@ -163,7 +163,7 @@ impl CompletionsMenu {
.map(|(id, completion)| {
StringMatchCandidate::new(
id,
completion.label.text[completion.label.filter_range.clone()].into(),
&completion.label.text[completion.label.filter_range.clone()],
)
})
.collect();
@@ -211,7 +211,7 @@ impl CompletionsMenu {
let match_candidates = choices
.iter()
.enumerate()
.map(|(id, completion)| StringMatchCandidate::new(id, completion.to_string()))
.map(|(id, completion)| StringMatchCandidate::new(id, &completion))
.collect();
let matches = choices
.iter()