From: Ian Jackson Date: Sat, 7 Aug 2021 17:43:29 +0000 (+0100) Subject: config macros: Promote atspan variable X-Git-Tag: hippotat/1.0.0~278 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=a4f0daade936c8f2c6f69f8d2e66248a8040eff6;p=hippotat.git config macros: Promote atspan variable We're going to want to use this in the other branches. Signed-off-by: Ian Jackson --- diff --git a/macros/macros.rs b/macros/macros.rs index 88828ae..f190bdb 100644 --- a/macros/macros.rs +++ b/macros/macros.rs @@ -56,8 +56,8 @@ pub fn resolve(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let mut skl = quote_spanned!{fname_span=> SectionKindList::Ordinary }; 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() { - let atspan = attr.path.segments.last().unwrap().ident.span(); method = attr.path.to_token_stream(); if &attr.path == &parse_quote!{ limited } { skl = quote_spanned!{atspan=> SectionKindList::Limited };