Merge pull request #2406 from omar25h/fix-subcmd

fix: subcommand with field name subcmd compilation
This commit is contained in:
Pavan Kumar Sunkara 2021-03-11 01:41:53 +05:30 committed by GitHub
commit 2952fd6d73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -315,7 +315,7 @@ pub fn gen_updater(
};
let updater = quote_spanned! { ty.span()=>
<#subcmd_type as clap::Subcommand>::update_from_subcommand(#field_name, subcmd);
<#subcmd_type as clap::Subcommand>::update_from_subcommand(#field_name, #arg_matches.subcommand());
};
let updater = match **ty {
@ -324,7 +324,7 @@ pub fn gen_updater(
#updater
} else {
*#field_name = <#subcmd_type as clap::Subcommand>::from_subcommand(
subcmd
#arg_matches.subcommand()
)
}
},
@ -335,7 +335,6 @@ pub fn gen_updater(
quote_spanned! { kind.span()=>
{
let subcmd = #arg_matches.subcommand();
#access
#updater
}