diff --git a/yaserde_derive/src/de/mod.rs b/yaserde_derive/src/de/mod.rs index ec5d9a2..ed0d17e 100644 --- a/yaserde_derive/src/de/mod.rs +++ b/yaserde_derive/src/de/mod.rs @@ -3,7 +3,7 @@ pub mod expand_enum; pub mod expand_struct; use crate::common::YaSerdeAttribute; -use proc_macro2::{Ident, TokenStream}; +use proc_macro2::TokenStream; use quote::quote; pub fn expand_derive_deserialize(ast: &syn::DeriveInput) -> Result { @@ -42,11 +42,9 @@ pub fn expand_derive_deserialize(ast: &syn::DeriveInput) -> Result unimplemented!(), }; - let dummy_const = Ident::new(&format!("_IMPL_YA_DESERIALIZE_FOR_{}", name), name.span()); - Ok(quote! { #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] - const #dummy_const: () = { + const _: () = { use ::std::str::FromStr as _; use ::yaserde::Visitor as _; diff --git a/yaserde_derive/src/ser/mod.rs b/yaserde_derive/src/ser/mod.rs index a09e181..f1064e6 100644 --- a/yaserde_derive/src/ser/mod.rs +++ b/yaserde_derive/src/ser/mod.rs @@ -6,7 +6,7 @@ pub mod label; pub mod namespace; use crate::common::YaSerdeAttribute; -use proc_macro2::{Ident, TokenStream}; +use proc_macro2::TokenStream; use quote::quote; pub fn expand_derive_serialize(ast: &syn::DeriveInput) -> Result { @@ -33,11 +33,9 @@ pub fn expand_derive_serialize(ast: &syn::DeriveInput) -> Result unimplemented!(), }; - let dummy_const = Ident::new(&format!("_IMPL_YA_SERIALIZE_FOR_{}", name), name.span()); - Ok(quote! { #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] - const #dummy_const: () = { + const _: () = { use ::std::str::FromStr as _; #impl_block