Skip to content

Commit

Permalink
Use a Result-returning clap method to prevent
Browse files Browse the repository at this point in the history
early bailing and messing up return code
  • Loading branch information
petr-tik committed Feb 17, 2022
1 parent ec80cda commit 672dcde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
Some(("get", args)) => {
let opts = cargo_config::GetOptions {
key: args.value_of("key"),
format: args.value_of_t_or_exit("format"),
format: args.value_of_t("format")?,
show_origin: args.is_present("show-origin"),
merged: args.value_of("merged") == Some("yes"),
};
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
.warn("the --prefix-depth flag has been changed to --prefix=depth")?;
tree::Prefix::Depth
} else {
args.value_of_t_or_exit("prefix")
args.value_of_t("prefix")?
};

let no_dedupe = args.is_present("no-dedupe") || args.is_present("all");
Expand Down

0 comments on commit 672dcde

Please sign in to comment.