mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
Remove duplicate empty value checker
This commit is contained in:
parent
10c7228b3f
commit
ca8623c774
2 changed files with 1 additions and 8 deletions
|
@ -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 '='...{:?}",
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue