#![allow(unused_mut)] // xxx
use syn::{parse_macro_input, parse_quote, Data, DataStruct, DeriveInput, Meta, NestedMeta, Path};
-use quote::{quote, quote_spanned};
+use quote::{quote, quote_spanned, ToTokens};
use proc_macro2::{Literal, TokenStream};
use itertools::Itertools;
for attr in &field.attrs {
if attr.tokens.is_empty() {
let atspan = attr.path.segments.last().unwrap().ident.span();
- method = quote!{ #attr.path };
+ method = attr.path.to_token_stream();
if &attr.path == &parse_quote!{ limited } {
skl = quote_spanned!{atspan=> SKL::Limited };
}
let (tmethod, tskl) = meta.nested.iter().collect_tuple().unwrap();
fn get_path(meta: &NestedMeta) -> TokenStream {
match meta {
- NestedMeta::Meta(Meta::Path(ref path)) => quote!{ #path },
+ NestedMeta::Meta(Meta::Path(ref path)) => path.to_token_stream(),
_ => panic!(),
}
}