Improve StringMatchCandidate::new interface (#22011)
Release Notes: - N/A
This commit is contained in:
@@ -283,11 +283,7 @@ impl PickerDelegate for CommandPaletteDelegate {
|
||||
let candidates = commands
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(ix, command)| StringMatchCandidate {
|
||||
id: ix,
|
||||
string: command.name.to_string(),
|
||||
char_bag: command.name.chars().collect(),
|
||||
})
|
||||
.map(|(ix, command)| StringMatchCandidate::new(ix, &command.name))
|
||||
.collect::<Vec<_>>();
|
||||
let matches = if query.is_empty() {
|
||||
candidates
|
||||
|
||||
Reference in New Issue
Block a user