diff options
Diffstat (limited to 'bzipper_macros/src')
-rw-r--r-- | bzipper_macros/src/impls/encode_enum.rs | 2 | ||||
-rw-r--r-- | bzipper_macros/src/lib.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/bzipper_macros/src/impls/encode_enum.rs b/bzipper_macros/src/impls/encode_enum.rs index 37acd34..7ecf3d5 100644 --- a/bzipper_macros/src/impls/encode_enum.rs +++ b/bzipper_macros/src/impls/encode_enum.rs @@ -44,7 +44,7 @@ pub fn encode_enum(data: &DataEnum) -> TokenStream { let mut field_captures = Vec::new(); for (index, field) in variant.fields.iter().enumerate() { - let capture = Ident::new(&format!("v{index}"), Span::call_site()); + let capture = Ident::new(&format!("value{index}"), Span::call_site()); field_names.push(&field.ident); field_captures.push(capture); diff --git a/bzipper_macros/src/lib.rs b/bzipper_macros/src/lib.rs index 9bb1480..db7ace7 100644 --- a/bzipper_macros/src/lib.rs +++ b/bzipper_macros/src/lib.rs @@ -25,7 +25,7 @@ use proc_macro::TokenStream; use quote::quote; -use syn::{parse_macro_input, Data, DeriveInput}; +use syn::{Data, DeriveInput}; macro_rules! use_mod { ($vis:vis $name:ident) => { @@ -43,7 +43,7 @@ mod impls; #[proc_macro_derive(Decode)] pub fn derive_decode(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); + let input = syn::parse_macro_input!(input as DeriveInput); let impl_body = match input.data { Data::Enum( ref data) => impls::decode_enum( data), @@ -73,7 +73,7 @@ pub fn derive_decode(input: TokenStream) -> TokenStream { #[proc_macro_derive(Encode)] pub fn derive_encode(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); + let input = syn::parse_macro_input!(input as DeriveInput); let impl_body = match input.data { Data::Enum( ref data) => impls::encode_enum( data), @@ -103,7 +103,7 @@ pub fn derive_encode(input: TokenStream) -> TokenStream { #[proc_macro_derive(SizedEncode)] pub fn derive_sized_encode(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); + let input = syn::parse_macro_input!(input as DeriveInput); let encode_impl_body = match input.data { Data::Enum( ref data) => impls::encode_enum( data), |