Skip to content

Commit

Permalink
refactor(complete): Simplify ArgValueCandidates code
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 21, 2024
1 parent 49b8108 commit 27b348d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions clap_complete/src/engine/complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,8 @@ fn complete_custom_arg_value(
) -> Vec<CompletionCandidate> {
debug!("complete_custom_arg_value: completer={completer:?}, value={value:?}");

let mut values = Vec::new();
let custom_arg_values = completer.candidates();
values.extend(custom_arg_values);

let mut values = completer.candidates();
values.retain(|comp| comp.get_content().starts_with(&value.to_string_lossy()));

values
}

Expand Down

0 comments on commit 27b348d

Please sign in to comment.