mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 23:02:31 +00:00
Resolve a FIXME
This commit is contained in:
parent
0242afee81
commit
cad893ed04
1 changed files with 2 additions and 5 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue