mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +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()=>
|
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 {
|
let updater = match **ty {
|
||||||
|
@ -324,7 +324,7 @@ pub fn gen_updater(
|
||||||
#updater
|
#updater
|
||||||
} else {
|
} else {
|
||||||
*#field_name = <#subcmd_type as clap::Subcommand>::from_subcommand(
|
*#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()=>
|
quote_spanned! { kind.span()=>
|
||||||
{
|
{
|
||||||
let subcmd = #arg_matches.subcommand();
|
|
||||||
#access
|
#access
|
||||||
#updater
|
#updater
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue