Skip to content

Commit fa616e8

Browse files
committed
Add FetchedItem implementation for bool
1 parent ea4d723 commit fa616e8

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.
@@ -1384,3 +1384,9 @@ impl<'w, 's, State: FetchState> Fetch<'w, 's> for NopFetch<State> {
13841384
#[inline(always)]
13851385
unsafe fn table_fetch(&mut self, _table_row: usize) -> Self::Item {}
13861386
}
1387+
1388+
/// This implementation won't allow us to correlate a boolean to a filter type. But having a dummy
1389+
/// for `bool` allows us to add `FetchedItem` bound to [`Fetch::Item`].
1390+
impl FetchedItem for bool {
1391+
type Query = ();
1392+
}

0 commit comments

Comments
 (0)