diff --git a/src/parse/validator.rs b/src/parse/validator.rs index 2ba7c798..e28302da 100644 --- a/src/parse/validator.rs +++ b/src/parse/validator.rs @@ -137,13 +137,10 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> { )); } - // FIXME: `(&mut *vtor)(args...)` can be simplified to `vtor(args...)` - // once https://github.com/rust-lang/rust/pull/72280 is landed on stable - // (about 10 weeks from now) if let Some(ref vtor) = arg.validator { debug!("Validator::validate_arg_values: checking validator..."); let mut vtor = vtor.lock().unwrap(); - if let Err(e) = (&mut *vtor)(&*val.to_string_lossy()) { + if let Err(e) = vtor(&*val.to_string_lossy()) { debug!("error"); return Err(Error::value_validation( arg.to_string(), @@ -158,7 +155,7 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> { if let Some(ref vtor) = arg.validator_os { debug!("Validator::validate_arg_values: checking validator_os..."); let mut vtor = vtor.lock().unwrap(); - if let Err(e) = (&mut *vtor)(val) { + if let Err(e) = vtor(val) { debug!("error"); return Err(Error::value_validation( arg.to_string(),