@@ -4,7 +4,7 @@ use syn::{
4
4
parse, Attribute , Data , DataEnum , DataStruct , DeriveInput , Fields , Generics , Ident , Index ,
5
5
} ;
6
6
7
- #[ proc_macro_derive( MemoryUsage , attributes( memoryusage ) ) ]
7
+ #[ proc_macro_derive( MemoryUsage , attributes( loupe ) ) ]
8
8
pub fn derive_memory_usage ( input : TokenStream ) -> TokenStream {
9
9
let derive_input: DeriveInput = parse ( input) . unwrap ( ) ;
10
10
@@ -61,7 +61,7 @@ fn derive_memory_usage_for_struct(
61
61
. named
62
62
. iter ( )
63
63
. filter_map ( |field| {
64
- if must_ignore ( & field. attrs ) {
64
+ if must_skip ( & field. attrs ) {
65
65
return None ;
66
66
}
67
67
@@ -87,7 +87,7 @@ fn derive_memory_usage_for_struct(
87
87
. iter ( )
88
88
. enumerate ( )
89
89
. filter_map ( |( nth, field) | {
90
- if must_ignore ( & field. attrs ) {
90
+ if must_skip ( & field. attrs ) {
91
91
return None ;
92
92
}
93
93
@@ -250,7 +250,7 @@ fn derive_memory_usage_for_enum(
250
250
}
251
251
} ;
252
252
253
- if must_ignore ( & variant. attrs ) {
253
+ if must_skip ( & variant. attrs ) {
254
254
sum = quote ! { 0 } ;
255
255
}
256
256
@@ -280,11 +280,11 @@ fn derive_memory_usage_for_enum(
280
280
. into ( )
281
281
}
282
282
283
- fn must_ignore ( attrs : & Vec < Attribute > ) -> bool {
283
+ fn must_skip ( attrs : & Vec < Attribute > ) -> bool {
284
284
attrs. iter ( ) . any ( |attr| {
285
- attr. path . is_ident ( "memoryusage " )
285
+ attr. path . is_ident ( "loupe " )
286
286
&& match attr. parse_args :: < Ident > ( ) {
287
- Ok ( e) if e. to_string ( ) == "ignore " => true ,
287
+ Ok ( e) if e. to_string ( ) == "skip " => true ,
288
288
_ => false ,
289
289
}
290
290
} )
0 commit comments