Skip to content

Commit 580d8d2

Browse files
committed
Fix part of the non_fmt_panic
1 parent 97343e4 commit 580d8d2

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
@@ -2318,11 +2318,11 @@ impl<'help> App<'help> {
23182318
.collect();
23192319

23202320
if !args_missing_help.is_empty() {
2321-
panic!(format!(
2321+
panic!(
23222322
"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: {}",
23232323
self.name,
23242324
args_missing_help.join(", ")
2325-
));
2325+
);
23262326
}
23272327
}
23282328

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)