Merge pull request #2346 from ldm0/non_fmt_panic_fix

Fix part of the non_fmt_panic warnings, bump version-sync to 0.9.2
This commit is contained in:
Pavan Kumar Sunkara 2021-02-14 01:58:26 +00:00 committed by GitHub
commit a8c9d28ead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 4 deletions

View file

@ -83,6 +83,7 @@ fn test_parse_hex() {
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err(); let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
assert!( assert!(
err.to_string().contains("invalid digit found in string"), err.to_string().contains("invalid digit found in string"),
"{}",
err err
); );
} }

View file

@ -149,6 +149,7 @@ fn test_parse_hex_function_path() {
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err(); let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
assert!( assert!(
err.to_string().contains("invalid digit found in string"), err.to_string().contains("invalid digit found in string"),
"{}",
err err
); );
} }

View file

@ -39,7 +39,7 @@ clap = { path = "../", version = "3.0.0-beta.2" }
[dev-dependencies] [dev-dependencies]
pretty_assertions = "0.6" pretty_assertions = "0.6"
version-sync = "0.8" version-sync = "0.9"
[features] [features]
default = [] default = []

View file

@ -2317,11 +2317,11 @@ impl<'help> App<'help> {
.collect(); .collect();
if !args_missing_help.is_empty() { if !args_missing_help.is_empty() {
panic!(format!( panic!(
"AppSettings::HelpRequired is enabled for the App {}, but at least one of its arguments does not have either `help` or `long_help` set. List of such arguments: {}", "AppSettings::HelpRequired is enabled for the App {}, but at least one of its arguments does not have either `help` or `long_help` set. List of such arguments: {}",
self.name, self.name,
args_missing_help.join(", ") args_missing_help.join(", ")
)); );
} }
} }

View file

@ -242,7 +242,7 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> {
)); ));
} }
panic!(INTERNAL_ERROR_MSG); panic!("{}", INTERNAL_ERROR_MSG);
} }
fn validate_conflicts(&mut self, matcher: &mut ArgMatcher) -> ClapResult<()> { fn validate_conflicts(&mut self, matcher: &mut ArgMatcher) -> ClapResult<()> {