From a4f0daade936c8f2c6f69f8d2e66248a8040eff6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Aug 2021 18:43:29 +0100 Subject: [PATCH] config macros: Promote atspan variable We're going to want to use this in the other branches. Signed-off-by: Ian Jackson --- macros/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }; -- 2.30.2