Remove duplicate empty value checker

This commit is contained in:
liudingming 2021-08-01 23:57:27 +08:00
parent 10c7228b3f
commit ca8623c774
2 changed files with 1 additions and 8 deletions

View file

@ -1288,14 +1288,6 @@ impl<'help, 'app> Parser<'help, 'app> {
if let Some(fv) = attached_value {
let v = fv.trim_start_n_matches(1, b'=');
if opt.is_set(ArgSettings::ForbidEmptyValues) && v.is_empty() {
debug!("Found Empty - Error");
return Err(ClapError::empty_value(
opt,
Usage::new(self).create_usage_with_title(&[]),
self.app.color(),
));
}
debug!("Found - {:?}, len: {}", v, v.len());
debug!(
"Parser::parse_opt: {:?} contains '='...{:?}",

View file

@ -107,6 +107,7 @@ impl<'a> ArgStr<'a> {
self.0.len()
}
#[allow(dead_code)]
pub(crate) fn is_empty(&self) -> bool {
self.0.is_empty()
}