Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of the non_fmt_panic warnings, bump version-sync to 0.9.2 #2346

Merged
merged 1 commit into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clap_derive/tests/custom-string-parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fn test_parse_hex() {
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
assert!(
err.to_string().contains("invalid digit found in string"),
"{}",
err
);
}
Expand Down
1 change: 1 addition & 0 deletions clap_derive/tests/non_literal_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ fn test_parse_hex_function_path() {
let err = HexOpt::try_parse_from(&["test", "-n", "gg"]).unwrap_err();
assert!(
err.to_string().contains("invalid digit found in string"),
"{}",
err
);
}
2 changes: 1 addition & 1 deletion clap_generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ clap = { path = "../", version = "3.0.0-beta.2" }

[dev-dependencies]
pretty_assertions = "0.6"
version-sync = "0.8"
version-sync = "0.9"

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions src/build/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2318,11 +2318,11 @@ impl<'help> App<'help> {
.collect();

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: {}",
self.name,
args_missing_help.join(", ")
));
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/parse/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down