11use proc_macro:: TokenStream ;
22use syn:: parse_macro_input;
33use syn:: DeriveInput ;
4- use quote :: quote ;
4+
55use quote:: ToTokens ;
66
77mod generator;
@@ -133,7 +133,7 @@ pub fn bitmap(input: TokenStream) -> TokenStream {
133133pub fn bitmap_attr ( _args : TokenStream , input : TokenStream ) -> TokenStream {
134134 let input = parse_macro_input ! ( input as DeriveInput ) ;
135135
136- // Convert the attribute macro input to the existing BitmapInput format
136+ // Converting the attribute macro input to the existing BitmapInput format
137137 let bitmap_input = convert_derive_to_bitmap_input ( input) ;
138138
139139 // Use the EXACT SAME expansion logic as the bitmap! macro
@@ -144,9 +144,9 @@ pub fn bitmap_attr(_args: TokenStream, input: TokenStream) -> TokenStream {
144144}
145145
146146fn convert_derive_to_bitmap_input ( input : DeriveInput ) -> parser:: BitmapInput {
147- let name = input. ident ; // Use 'name' not 'struct_name'
147+ let name = input. ident ;
148148
149- // Extract struct fields
149+ // Extracting struct fields
150150 let syn:: Data :: Struct ( data_struct) = input. data else {
151151 panic ! ( "#[bitmap_attr] can only be used on structs" ) ;
152152 } ;
@@ -155,12 +155,12 @@ fn convert_derive_to_bitmap_input(input: DeriveInput) -> parser::BitmapInput {
155155 panic ! ( "#[bitmap_attr] struct must have named fields" ) ;
156156 } ;
157157
158- // Convert each field to the format expected by the existing parser
158+ // Converting each field to the format expected by the existing parser
159159 let fields = fields_named. named . into_iter ( ) . map ( |field| {
160160 let field_name = field. ident . expect ( "Field must have a name" ) ;
161161 let field_type = field. ty ;
162162
163- // Extract the size from the type (e.g., u1 -> 1, u7 -> 7)
163+ // Extracting the size from the type (e.g., u1 -> 1, u7 -> 7)
164164 let type_str = field_type. to_token_stream ( ) . to_string ( ) ;
165165
166166 if !type_str. starts_with ( "u" ) {
@@ -180,7 +180,7 @@ fn convert_derive_to_bitmap_input(input: DeriveInput) -> parser::BitmapInput {
180180 } ) . collect ( ) ;
181181
182182 parser:: BitmapInput {
183- name, // Use 'name' not 'struct_name'
183+ name,
184184 fields,
185185 }
186186}
0 commit comments