diff --git a/clap_derive/src/derives/args.rs b/clap_derive/src/derives/args.rs index 08ddcc91307..a2fcdf5a382 100644 --- a/clap_derive/src/derives/args.rs +++ b/clap_derive/src/derives/args.rs @@ -136,6 +136,7 @@ pub fn gen_from_arg_matches_for_struct( } fn from_arg_matches_mut(__clap_arg_matches: &mut clap::ArgMatches) -> ::std::result::Result { + #[allow(deprecated)] // Assuming any deprecation in here will be related to a deprecation in `Args` let v = #struct_name #constructor; ::std::result::Result::Ok(v) } @@ -145,6 +146,7 @@ pub fn gen_from_arg_matches_for_struct( } fn update_from_arg_matches_mut(&mut self, __clap_arg_matches: &mut clap::ArgMatches) -> ::std::result::Result<(), clap::Error> { + #[allow(deprecated)] // Assuming any deprecation in here will be related to a deprecation in `Args` #updater ::std::result::Result::Ok(()) } diff --git a/clap_derive/src/derives/subcommand.rs b/clap_derive/src/derives/subcommand.rs index 343c4e3e412..c10aeafdf91 100644 --- a/clap_derive/src/derives/subcommand.rs +++ b/clap_derive/src/derives/subcommand.rs @@ -542,6 +542,8 @@ fn gen_from_arg_matches( quote! { fn from_arg_matches_mut(__clap_arg_matches: &mut clap::ArgMatches) -> ::std::result::Result { + #[allow(deprecated)] // Assuming any deprecation in here will be related to a deprecation in `Subcommand` + #( #child_subcommands )else* if let Some((#subcommand_name_var, mut __clap_arg_sub_matches)) = __clap_arg_matches.remove_subcommand() { @@ -657,6 +659,8 @@ fn gen_update_from_arg_matches( &mut self, __clap_arg_matches: &mut clap::ArgMatches, ) -> ::std::result::Result<(), clap::Error> { + #[allow(deprecated)] // Assuming any deprecation in here will be related to a deprecation in `Subcommand` + if let Some(__clap_name) = __clap_arg_matches.subcommand_name() { match self { #( #subcommands ),*