Skip to content

Commit ba68958

Browse files
committed
Add FetchedItem implementation for bool
1 parent 005fbf6 commit ba68958

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/bevy_ecs/src/query/fetch.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub trait FetchedItem {
264264
/// # my_system.system();
265265
/// ```
266266
pub trait Fetch<'world, 'state>: Sized {
267-
type Item;
267+
type Item: FetchedItem;
268268
type State: FetchState;
269269

270270
/// Creates a new instance of this fetch.
@@ -1497,3 +1497,9 @@ impl<'w, 's, State: FetchState> Fetch<'w, 's> for NopFetch<State> {
14971497
#[inline(always)]
14981498
unsafe fn table_fetch(&mut self, _table_row: usize) -> Self::Item {}
14991499
}
1500+
1501+
/// This implementation won't allow us to correlate a boolean to a filter type. But having a dummy
1502+
/// for `bool` allows us to add `FetchedItem` bound to [`Fetch::Item`].
1503+
impl FetchedItem for bool {
1504+
type Query = ();
1505+
}

0 commit comments

Comments
 (0)