@@ -41,8 +41,8 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
41
41
attr. parse_args_with ( |input : ParseStream | {
42
42
let meta = input. parse_terminated :: < syn:: Meta , syn:: token:: Comma > ( syn:: Meta :: parse) ?;
43
43
for meta in meta {
44
- let ident = meta. path ( ) . get_ident ( ) ;
45
- if ident. map_or ( false , |ident| ident == MUTABLE_ATTRIBUTE_NAME ) {
44
+ let ident = meta. path ( ) . get_ident ( ) . expect ( format ! ( "Unrecognized attribute: `{}`" , meta . path ( ) . to_token_stream ( ) ) ) ;
45
+ if ident == MUTABLE_ATTRIBUTE_NAME {
46
46
if let syn:: Meta :: Path ( _) = meta {
47
47
fetch_struct_attributes. is_mutable = true ;
48
48
} else {
@@ -51,7 +51,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
51
51
MUTABLE_ATTRIBUTE_NAME
52
52
) ;
53
53
}
54
- } else if ident. map_or ( false , |ident| ident == DERIVE_ATTRIBUTE_NAME ) {
54
+ } else if ident == DERIVE_ATTRIBUTE_NAME {
55
55
if let syn:: Meta :: List ( meta_list) = meta {
56
56
fetch_struct_attributes
57
57
. derive_args
@@ -62,7 +62,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
62
62
DERIVE_ATTRIBUTE_NAME
63
63
) ;
64
64
}
65
- } else if ident. map_or ( false , |ident| ident == FILTER_ATTRIBUTE_NAME ) {
65
+ } else if ident == FILTER_ATTRIBUTE_NAME {
66
66
if let syn:: Meta :: Path ( _) = meta {
67
67
fetch_struct_attributes. is_filter = true ;
68
68
} else {
@@ -479,12 +479,12 @@ fn read_world_query_field_info(
479
479
let attrs = field
480
480
. attrs
481
481
. iter ( )
482
- . cloned ( )
483
482
. filter ( |attr| {
484
483
attr. path
485
484
. get_ident ( )
486
485
. map_or ( true , |ident| ident != WORLD_QUERY_ATTRIBUTE_NAME )
487
486
} )
487
+ . cloned ( )
488
488
. collect ( ) ;
489
489
490
490
let field_type = field. ty . clone ( ) ;
0 commit comments