move augment_clap into inherent impl

This commit is contained in:
William Yao 2017-07-07 12:40:10 -05:00 committed by Guillaume P
parent f6bd33d5de
commit 443cc3e145
2 changed files with 5 additions and 5 deletions

View file

@ -26,9 +26,6 @@ pub trait StructOpt {
/// Returns the corresponding `clap::App`.
fn clap<'a, 'b>() -> clap::App<'a, 'b>;
/// Add this app's arguments/subcommands to another `clap::App`.
fn augment_clap<'a, 'b>(clap::App<'a, 'b>) -> clap::App<'a, 'b>;
/// Creates the struct from `clap::ArgMatches`.
fn from_clap(clap::ArgMatches) -> Self;

View file

@ -615,9 +615,12 @@ fn impl_structopt_for_struct(name: &Ident, fields: &[Field], attrs: &[Attribute]
quote! {
impl _structopt::StructOpt for #name {
#clap
#augment_clap
#from_clap
}
impl #name {
#augment_clap
}
}
}
@ -637,11 +640,11 @@ fn impl_structopt_for_enum(name: &Ident, variants: &[Variant], attrs: &[Attribut
quote! {
impl _structopt::StructOpt for #name {
#clap
#augment_clap
#from_clap
}
impl #name {
#augment_clap
#from_subcommand
}
}