]> git.proxmox.com Git - cargo.git/commitdiff
refactor: Resolve SubCommand::with_new deprecation
authorEd Page <eopage@gmail.com>
Thu, 6 Jan 2022 02:09:07 +0000 (20:09 -0600)
committerEd Page <eopage@gmail.com>
Thu, 6 Jan 2022 15:14:12 +0000 (09:14 -0600)
src/cargo/util/command_prelude.rs

index 21cb8076e9c7df73934ec9b98d8148e031068ec2..b5c10c1893784df9ddb19620148f4b008280700a 100644 (file)
@@ -17,7 +17,6 @@ use crate::util::{
 use crate::CargoResult;
 use anyhow::bail;
 use cargo_util::paths;
-use clap::{self, SubCommand};
 use std::ffi::{OsStr, OsString};
 use std::path::PathBuf;
 
@@ -282,8 +281,7 @@ pub fn multi_opt(name: &'static str, value_name: &'static str, help: &'static st
 }
 
 pub fn subcommand(name: &'static str) -> App {
-    SubCommand::with_name(name)
-        .setting(AppSettings::DeriveDisplayOrder | AppSettings::DontCollapseArgsInUsage)
+    App::new(name).setting(AppSettings::DeriveDisplayOrder | AppSettings::DontCollapseArgsInUsage)
 }
 
 /// Determines whether or not to gate `--profile` as unstable when resolving it.