Lines Matching refs:ty
24 mod ty; module
29 ty::{is_simple_ty, sub_type, subty_if_name, Ty},
77 if let Kind::Subcommand(ty) = &*kind { in gen_augmentation()
78 let subcmd_type = match (**ty, sub_type(&field.ty)) { in gen_augmentation()
80 _ => &field.ty, in gen_augmentation()
82 let required = if **ty == Ty::Option { in gen_augmentation()
128 let ty = &field.ty; in gen_augmentation() localVariable
130 let #app_var = <#ty as ::structopt::StructOptInternal>::augment_clap(#app_var); in gen_augmentation()
131 let #app_var = if <#ty as ::structopt::StructOptInternal>::is_subcommand() { in gen_augmentation()
138 Kind::Arg(ty) => { in gen_augmentation()
139 let convert_type = match **ty { in gen_augmentation()
140 Ty::Vec | Ty::Option => sub_type(&field.ty).unwrap_or(&field.ty), in gen_augmentation()
142 sub_type(&field.ty).and_then(sub_type).unwrap_or(&field.ty) in gen_augmentation()
144 _ => &field.ty, in gen_augmentation()
166 let modifier = match **ty { in gen_augmentation()
167 Ty::Bool => quote_spanned! { ty.span()=> in gen_augmentation()
172 Ty::Option => quote_spanned! { ty.span()=> in gen_augmentation()
178 Ty::OptionOption => quote_spanned! { ty.span()=> in gen_augmentation()
186 Ty::OptionVec => quote_spanned! { ty.span()=> in gen_augmentation()
193 Ty::Vec => quote_spanned! { ty.span()=> in gen_augmentation()
199 Ty::Other if occurrences => quote_spanned! { ty.span()=> in gen_augmentation()
204 Ty::Other if flag => quote_spanned! { ty.span()=> in gen_augmentation()
211 quote_spanned! { ty.span()=> in gen_augmentation()
270 Kind::Subcommand(ty) => { in gen_constructor()
271 let subcmd_type = match (**ty, sub_type(&field.ty)) { in gen_constructor()
273 _ => &field.ty, in gen_constructor()
275 let unwrapper = match **ty { in gen_constructor()
277 _ => quote_spanned!( ty.span()=> .unwrap() ), in gen_constructor()
295 Kind::Arg(ty) => { in gen_constructor()
333 let field_value = match **ty { in gen_constructor()
334 Ty::Bool => quote_spanned!(ty.span()=> #matches.is_present(#name)), in gen_constructor()
336 Ty::Option => quote_spanned! { ty.span()=> in gen_constructor()
341 Ty::OptionOption => quote_spanned! { ty.span()=> in gen_constructor()
349 Ty::OptionVec => quote_spanned! { ty.span()=> in gen_constructor()
358 Ty::Vec => quote_spanned! { ty.span()=> in gen_constructor()
363 Ty::Other if occurrences => quote_spanned! { ty.span()=> in gen_constructor()
367 Ty::Other if flag => quote_spanned! { ty.span()=> in gen_constructor()
371 Ty::Other => quote_spanned! { ty.span()=> in gen_constructor()
498 let ty = &unnamed[0]; in gen_augment_clap_enum() localVariable
500 let app = <#ty as ::structopt::StructOptInternal>::augment_clap(app); in gen_augment_clap_enum()
516 let ty = &unnamed[0]; in gen_augment_clap_enum() localVariable
517 quote_spanned! { ty.span()=> in gen_augment_clap_enum()
519 … let #app_var = <#ty as ::structopt::StructOptInternal>::augment_clap( in gen_augment_clap_enum()
522 if <#ty as ::structopt::StructOptInternal>::is_subcommand() { in gen_augment_clap_enum()
604 let ty = match variant.fields { in gen_from_subcommand() localVariable
605 Unnamed(ref fields) if fields.unnamed.len() == 1 => &fields.unnamed[0].ty, in gen_from_subcommand()
615 let (span, str_ty, values_of) = match subty_if_name(ty, "Vec") { in gen_from_subcommand()
633 ty, in gen_from_subcommand()
687 let ty = &fields.unnamed[0]; in gen_from_subcommand() localVariable
688 quote!( ( <#ty as ::structopt::StructOpt>::from_clap(#matches) ) ) in gen_from_subcommand()
707 let ty = &fields.unnamed[0]; in gen_from_subcommand() localVariable
710 <#ty as ::structopt::StructOptInternal>::from_subcommand(#other) in gen_from_subcommand()