mirror of
https://github.com/clap-rs/clap
synced 2024-11-16 01:18:00 +00:00
refactor: Switch to getter for number_of_values
This commit is contained in:
parent
f40447bc26
commit
b47464955c
2 changed files with 3 additions and 3 deletions
|
@ -4531,7 +4531,7 @@ pub(crate) fn render_arg_val(arg: &Arg) -> String {
|
|||
|
||||
let mut extra_values = false;
|
||||
debug_assert!(arg.is_takes_value_set());
|
||||
let num_vals = arg.num_vals.unwrap_or_else(|| {
|
||||
let num_vals = arg.get_num_vals().unwrap_or_else(|| {
|
||||
if arg.is_multiple_values_set() {
|
||||
(1..).into()
|
||||
} else {
|
||||
|
@ -4547,7 +4547,7 @@ pub(crate) fn render_arg_val(arg: &Arg) -> String {
|
|||
}
|
||||
rendered.push_str(&arg_name);
|
||||
}
|
||||
extra_values |= arg.num_vals.is_none() && arg.is_multiple_values_set();
|
||||
extra_values |= arg.get_num_vals().is_none() && arg.is_multiple_values_set();
|
||||
extra_values |= min < num_vals.max_values();
|
||||
} else {
|
||||
debug_assert!(1 < val_names.len());
|
||||
|
|
|
@ -270,7 +270,7 @@ impl<'help, 'cmd> Validator<'help, 'cmd> {
|
|||
));
|
||||
}
|
||||
|
||||
if let Some(expected) = a.num_vals {
|
||||
if let Some(expected) = a.get_num_vals() {
|
||||
if let Some(expected) = expected.num_values() {
|
||||
if expected != actual {
|
||||
debug!(
|
||||
|
|
Loading…
Reference in a new issue