From 7a925552338e3c614ec16d4bf5eeefdcb8abc80c Mon Sep 17 00:00:00 2001 From: robem Date: Tue, 6 Sep 2022 21:24:40 +0000 Subject: [PATCH] Update WorldQueryGats doc with type aliases (#5898) Make API users aware that the type aliases `QueryItem` and `QueryFetch` can be used instead of the more bloated alternative with `WorldQueryGats`. Fixes #5842 --- crates/bevy_ecs/src/query/fetch.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/query/fetch.rs b/crates/bevy_ecs/src/query/fetch.rs index 5379c3aa8d..a467094480 100644 --- a/crates/bevy_ecs/src/query/fetch.rs +++ b/crates/bevy_ecs/src/query/fetch.rs @@ -436,7 +436,9 @@ pub unsafe trait WorldQuery: for<'w> WorldQueryGats<'w> { ) -> bool; } -/// A helper trait for [`WorldQuery`] that works around Rust's lack of Generic Associated Types +/// A helper trait for [`WorldQuery`] that works around Rust's lack of Generic Associated Types. +/// +/// **Note**: Consider using the type aliases [`QueryItem`] and [`QueryFetch`] when using `Item` or `Fetch`. pub trait WorldQueryGats<'world> { type Item; type Fetch;