mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fix: subcommand with field name subcmd compilation
This commit is contained in:
parent
975ceed904
commit
777e0f43cb
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue