Skip to content

Commit a717b7b

Browse files
vladbat00MinerSebas
andcommitted
Apply suggestions from code review
Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
1 parent 8574a8a commit a717b7b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/bevy_ecs/macros/src/fetch.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,9 @@ fn read_world_query_field_type_info(
674674
panic!("Invalid tuple element: PhantomData");
675675
}
676676
is_phantom = true;
677-
} else if segment.ident != "Entity" {
677+
} else if segment.ident == "Entity" {
678+
// Nothing to do here
679+
} else {
678680
assert_not_generic(path, generic_names);
679681

680682
// Here, we assume that this member is another type that implements `Fetch`.

crates/bevy_ecs/src/query/fetch.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ pub type QueryItem<'w, 's, Q> = <<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Ite
159159
/// println!("Total (mut): {}", health.total());
160160
/// }
161161
/// }
162+
/// # my_system.system();
162163
/// ```
163164
///
164165
/// If you want to use derive macros with read-only query variants, you need to pass them with
@@ -257,11 +258,11 @@ pub type QueryItem<'w, 's, Q> = <<Q as WorldQuery>::Fetch as Fetch<'w, 's>>::Ite
257258
///
258259
/// ## Limitations
259260
///
260-
/// Currently, we don't support members that have a manual [`WorldQuery`] implementation if their
261+
/// Currently, we don't support members that have a [`WorldQuery`] implementation where their
261262
/// [`Fetch::Item`] is different from the member type. For instance, the following code won't
262263
/// compile:
263264
///
264-
/// ```ignore
265+
/// ```compile_fail
265266
/// #[derive(Component)]
266267
/// struct CustomQueryParameter;
267268
/// #[derive(Component)]

0 commit comments

Comments
 (0)