Skip to content

Commit 0607d66

Browse files
committed
refactor(complete): Remove unused allocation
1 parent 943de73 commit 0607d66

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

clap_complete/src/engine/complete.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,13 @@ fn populate_arg_candidate(candidate: CompletionCandidate, arg: &clap::Arg) -> Co
559559
}
560560

561561
/// Get the possible values for completion
562-
fn possible_values(a: &clap::Arg) -> Option<Vec<clap::builder::PossibleValue>> {
562+
fn possible_values(
563+
a: &clap::Arg,
564+
) -> Option<Box<dyn Iterator<Item = clap::builder::PossibleValue> + '_>> {
563565
if !a.get_num_args().expect("built").takes_values() {
564566
None
565567
} else {
566-
a.get_value_parser()
567-
.possible_values()
568-
.map(|pvs| pvs.collect())
568+
a.get_value_parser().possible_values()
569569
}
570570
}
571571

0 commit comments

Comments
 (0)