]> git.proxmox.com Git - cargo.git/commitdiff
refactor: Resolve App::get_matches_safe deprecation
authorEd Page <eopage@gmail.com>
Thu, 6 Jan 2022 02:01:33 +0000 (20:01 -0600)
committerEd Page <eopage@gmail.com>
Thu, 6 Jan 2022 15:13:51 +0000 (09:13 -0600)
src/bin/cargo/cli.rs

index a351ff57978e529bcb9e7ecfc5bb934b6070ee7e..0c6882f25f016a6c6c65cbf10e207cf0a25f04e1 100644 (file)
@@ -30,7 +30,7 @@ pub fn main(config: &mut Config) -> CliResult {
         return Ok(());
     }
 
-    let args = match cli().get_matches_safe() {
+    let args = match cli().try_get_matches() {
         Ok(args) => args,
         Err(e) => {
             if e.kind == clap::ErrorKind::UnrecognizedSubcommand {
@@ -290,7 +290,7 @@ For more information, see issue #10049 <https://github.com/rust-lang/cargo/issue
                 let global_args = GlobalArgs::new(args);
                 let new_args = cli()
                     .setting(AppSettings::NoBinaryName)
-                    .get_matches_from_safe(alias)?;
+                    .try_get_matches_from(alias)?;
 
                 let new_cmd = new_args.subcommand_name().expect("subcommand is required");
                 already_expanded.push(cmd.to_string());