Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
  • Loading branch information
mvlabat and MinerSebas authored Feb 10, 2022
1 parent 9fbb8a7 commit 61b4780
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/bevy_ecs/macros/src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
attr.parse_args_with(|input: ParseStream| {
let meta = input.parse_terminated::<syn::Meta, syn::token::Comma>(syn::Meta::parse)?;
for meta in meta {
let ident = meta.path().get_ident();
if ident.map_or(false, |ident| ident == MUTABLE_ATTRIBUTE_NAME) {
let ident = meta.path().get_ident().expect(format!("Unrecognized attribute: `{}`", meta.path().to_token_stream()));
if ident == MUTABLE_ATTRIBUTE_NAME {
if let syn::Meta::Path(_) = meta {
fetch_struct_attributes.is_mutable = true;
} else {
Expand All @@ -51,7 +51,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
MUTABLE_ATTRIBUTE_NAME
);
}
} else if ident.map_or(false, |ident| ident == DERIVE_ATTRIBUTE_NAME) {
} else if ident == DERIVE_ATTRIBUTE_NAME {
if let syn::Meta::List(meta_list) = meta {
fetch_struct_attributes
.derive_args
Expand All @@ -62,7 +62,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream {
DERIVE_ATTRIBUTE_NAME
);
}
} else if ident.map_or(false, |ident| ident == FILTER_ATTRIBUTE_NAME) {
} else if ident == FILTER_ATTRIBUTE_NAME {
if let syn::Meta::Path(_) = meta {
fetch_struct_attributes.is_filter = true;
} else {
Expand Down Expand Up @@ -479,12 +479,12 @@ fn read_world_query_field_info(
let attrs = field
.attrs
.iter()
.cloned()
.filter(|attr| {
attr.path
.get_ident()
.map_or(true, |ident| ident != WORLD_QUERY_ATTRIBUTE_NAME)
})
.cloned()
.collect();

let field_type = field.ty.clone();
Expand Down

0 comments on commit 61b4780

Please sign in to comment.