Improve StringMatchCandidate::new interface (#22011)
Release Notes: - N/A
This commit is contained in:
@@ -113,13 +113,7 @@ impl PickerDelegate for ExtensionVersionSelectorDelegate {
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(id, extension)| {
|
||||
let text = format!("v{}", extension.manifest.version);
|
||||
|
||||
StringMatchCandidate {
|
||||
id,
|
||||
char_bag: text.as_str().into(),
|
||||
string: text,
|
||||
}
|
||||
StringMatchCandidate::new(id, &format!("v{}", extension.manifest.version))
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
||||
@@ -328,11 +328,7 @@ impl ExtensionsPage {
|
||||
let match_candidates = dev_extensions
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(ix, manifest)| StringMatchCandidate {
|
||||
id: ix,
|
||||
string: manifest.name.clone(),
|
||||
char_bag: manifest.name.as_str().into(),
|
||||
})
|
||||
.map(|(ix, manifest)| StringMatchCandidate::new(ix, &manifest.name))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let matches = match_strings(
|
||||
|
||||
Reference in New Issue
Block a user