mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
refactor(parser): Remove dead code
This commit is contained in:
parent
44e1095166
commit
ac64391910
1 changed files with 3 additions and 8 deletions
|
@ -88,12 +88,7 @@ impl<'help, 'cmd> Validator<'help, 'cmd> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn validate_arg_values(
|
fn validate_arg_values(&self, arg: &Arg, ma: &MatchedArg) -> ClapResult<()> {
|
||||||
&self,
|
|
||||||
arg: &Arg,
|
|
||||||
ma: &MatchedArg,
|
|
||||||
matcher: &ArgMatcher,
|
|
||||||
) -> ClapResult<()> {
|
|
||||||
debug!("Validator::validate_arg_values: arg={:?}", arg.name);
|
debug!("Validator::validate_arg_values: arg={:?}", arg.name);
|
||||||
for val in ma.raw_vals_flatten() {
|
for val in ma.raw_vals_flatten() {
|
||||||
if !arg.possible_vals.is_empty() {
|
if !arg.possible_vals.is_empty() {
|
||||||
|
@ -121,7 +116,7 @@ impl<'help, 'cmd> Validator<'help, 'cmd> {
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
#![allow(deprecated)]
|
#![allow(deprecated)]
|
||||||
if arg.is_forbid_empty_values_set() && val.is_empty() && matcher.contains(&arg.id) {
|
if arg.is_forbid_empty_values_set() && val.is_empty() {
|
||||||
debug!("Validator::validate_arg_values: illegal empty val found");
|
debug!("Validator::validate_arg_values: illegal empty val found");
|
||||||
return Err(Error::empty_value(
|
return Err(Error::empty_value(
|
||||||
self.cmd,
|
self.cmd,
|
||||||
|
@ -327,7 +322,7 @@ impl<'help, 'cmd> Validator<'help, 'cmd> {
|
||||||
);
|
);
|
||||||
if let Some(arg) = self.cmd.find(name) {
|
if let Some(arg) = self.cmd.find(name) {
|
||||||
self.validate_arg_num_vals(arg, ma)?;
|
self.validate_arg_num_vals(arg, ma)?;
|
||||||
self.validate_arg_values(arg, ma, matcher)?;
|
self.validate_arg_values(arg, ma)?;
|
||||||
self.validate_arg_num_occurs(arg, ma)?;
|
self.validate_arg_num_occurs(arg, ma)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Reference in a new issue