From 8aaaaadeb48e9499f7243e2856b6636368040c0e Mon Sep 17 00:00:00 2001 From: SOFe Date: Tue, 21 Mar 2023 22:33:37 +0800 Subject: [PATCH] fix: update syn API usages --- codegen/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index cdcab02..1ff77dd 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -31,7 +31,7 @@ fn xylem_impl(ts: TokenStream) -> Result { let mut processable = false; for attr in &input.attrs { - if attr.path.is_ident("xylem") { + if attr.path().is_ident("xylem") { let attr_list: Punctuated = attr.parse_args_with(Punctuated::parse_terminated)?; for attr in attr_list { @@ -69,7 +69,7 @@ fn xylem_impl(ts: TokenStream) -> Result { .iter() .map(|param| match param { syn::GenericParam::Type(syn::TypeParam { ident, .. }) => quote!(#ident), - syn::GenericParam::Lifetime(syn::LifetimeDef { lifetime, .. }) => { + syn::GenericParam::Lifetime(syn::LifetimeParam { lifetime, .. }) => { quote!(#lifetime) } syn::GenericParam::Const(syn::ConstParam { ident, .. }) => quote!(#ident), @@ -264,7 +264,7 @@ fn xylem_impl(ts: TokenStream) -> Result { ) } syn::Data::Union(data) => { - return Err(Error::new_spanned(&data.union_token, "Unions are not supported")); + return Err(Error::new_spanned(data.union_token, "Unions are not supported")); } }; @@ -460,7 +460,7 @@ fn process_field( let mut from_attrs = TokenStream::new(); for attr in &field.attrs { - if attr.path.is_ident("xylem") { + if attr.path().is_ident("xylem") { let attrs: Punctuated = attr.parse_args_with(Punctuated::parse_terminated)?; for attr in attrs {