diff --git a/clap_complete/src/engine/complete.rs b/clap_complete/src/engine/complete.rs index 34110062bee..24fc9cac291 100644 --- a/clap_complete/src/engine/complete.rs +++ b/clap_complete/src/engine/complete.rs @@ -351,12 +351,8 @@ fn complete_custom_arg_value( ) -> Vec { 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 }