let fname = &field.ident.as_ref().unwrap();
let fname_span = fname.span();
let mut skl = None;
+ let mut set_skl = |new| {
+ if let Some(old) = &skl { panic!("dup SKL {} and {} for field {}",
+ old, new, &fname); }
+ skl = Some(new);
+ };
let mut method = quote_spanned!{fname_span=> ordinary };
for attr in &field.attrs {
let atspan = attr.path.segments.last().unwrap().ident.span();
if attr.tokens.is_empty() {
if &attr.path == &parse_quote!{ per_client } {
- skl = Some(quote_spanned!{fname_span=> SectionKindList::PerClient });
+ set_skl(quote_spanned!{fname_span=> SectionKindList::PerClient });
continue;
} else if &attr.path == &parse_quote!{ global } {
- skl = Some(quote_spanned!{fname_span=>
- SectionKindList::Global });
+ set_skl(quote_spanned!{fname_span=> SectionKindList::Global });
continue;
}
method = attr.path.to_token_stream();
if &attr.path == &parse_quote!{ limited } {
- skl = Some(quote_spanned!{atspan=> SectionKindList::Limited });
+ set_skl(quote_spanned!{atspan=> SectionKindList::Limited });
} else if &attr.path == &parse_quote!{ client } {
- skl = Some(quote_spanned!{atspan=> SectionKindList::PerClient });
+ set_skl(quote_spanned!{atspan=> SectionKindList::PerClient });
} else if &attr.path == &parse_quote!{ computed } {
- skl = Some(quote_spanned!{atspan=> SectionKindList::None });
+ set_skl(quote_spanned!{atspan=> SectionKindList::None });
}
} else if &attr.path == &parse_quote!{ special } {
let meta = match attr.parse_meta().unwrap() {
}
}
method = get_path(tmethod);
- skl = Some(get_path(tskl));
+ set_skl(get_path(tskl));
}
}
let fname_string = fname.to_string();