Skip to content

Commit a8c9d28

Browse files
authored
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
2 parents 5025ed3 + 580d8d2 commit a8c9d28

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

clap_derive/tests/custom-string-parsers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ fn test_parse_hex() {
8383
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
8484
assert!(
8585
err.to_string().contains("invalid digit found in string"),
86+
"{}",
8687
err
8788
);
8889
}

clap_derive/tests/non_literal_attributes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ fn test_parse_hex_function_path() {
149149
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
150150
assert!(
151151
err.to_string().contains("invalid digit found in string"),
152+
"{}",
152153
err
153154
);
154155
}

clap_generate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ clap = { path = "../", version = "3.0.0-beta.2" }
3939

4040
[dev-dependencies]
4141
pretty_assertions = "0.6"
42-
version-sync = "0.8"
42+
version-sync = "0.9"
4343

4444
[features]
4545
default = []

src/build/app/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,11 +2317,11 @@ impl<'help> App<'help> {
23172317
.collect();
23182318

23192319
if !args_missing_help.is_empty() {
2320-
panic!(format!(
2320+
panic!(
23212321
"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: {}",
23222322
self.name,
23232323
args_missing_help.join(", ")
2324-
));
2324+
);
23252325
}
23262326
}
23272327

src/parse/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> {
242242
));
243243
}
244244

245-
panic!(INTERNAL_ERROR_MSG);
245+
panic!("{}", INTERNAL_ERROR_MSG);
246246
}
247247

248248
fn validate_conflicts(&mut self, matcher: &mut ArgMatcher) -> ClapResult<()> {

0 commit comments

Comments
 (0)