move assert

This commit is contained in:
William Yao 2017-07-07 12:41:55 -05:00 committed by Guillaume P
parent 443cc3e145
commit a7224b5255

View file

@ -359,6 +359,9 @@ fn gen_augmentation(fields: &[Field], app_var: &Ident) -> quote::Tokens {
quote!( let #app_var = #subcmd_type ::augment_clap( #app_var ); )
})
.collect();
assert!(subcmds.len() <= 1, "cannot have more than one nested subcommand");
let args = fields.iter()
.filter(|&field| !is_subcommand(field))
.map(|field| {
@ -391,8 +394,6 @@ fn gen_augmentation(fields: &[Field], app_var: &Ident) -> quote::Tokens {
quote!( .arg(_structopt::clap::Arg::with_name(stringify!(#name)) #modifier #(#from_attr)*) )
});
assert!(subcmds.len() <= 1, "cannot have more than one nested subcommand");
quote! {{
use std::error::Error;
let #app_var = #app_var #( #args )* ;