From cbd378e5398861526d8365d68843194d060268b4 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Thu, 12 Jul 2018 20:03:04 -0400 Subject: [PATCH] refactor: changes validator signature to match v3 --- tests/custom-string-parsers.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/custom-string-parsers.rs b/tests/custom-string-parsers.rs index 535e646d..d0c60904 100644 --- a/tests/custom-string-parsers.rs +++ b/tests/custom-string-parsers.rs @@ -88,7 +88,7 @@ fn test_parse_hex() { fn custom_parser_1(_: &str) -> &'static str { "A" } fn custom_parser_2(_: &str) -> Result<&'static str, u32> { Ok("B") } fn custom_parser_3(_: &OsStr) -> &'static str { "C" } -fn custom_parser_4(_: &OsStr) -> Result<&'static str, OsString> { Ok("D") } +fn custom_parser_4(_: &OsStr) -> Result<&'static str, String> { Ok("D") } #[derive(Clap, PartialEq, Debug)] struct NoOpOpt { @@ -172,7 +172,11 @@ struct Occurrences { #[clap(short = "r", parse(from_occurrences))] little_unsigned: u8, - #[clap(short = "c", long = "custom", parse(from_occurrences = "foo"))] + #[clap( + short = "c", + long = "custom", + parse(from_occurrences = "foo") + )] custom: Foo, } @@ -205,7 +209,11 @@ fn test_custom_bool() { struct Opt { #[clap(short = "d", parse(try_from_str = "parse_bool"))] debug: bool, - #[clap(short = "v", default_value = "false", parse(try_from_str = "parse_bool"))] + #[clap( + short = "v", + default_value = "false", + parse(try_from_str = "parse_bool") + )] verbose: bool, #[clap(short = "t", parse(try_from_str = "parse_bool"))] tribool: Option,