Skip to content

Commit

Permalink
Add FetchedItem implementation for bool
Browse files Browse the repository at this point in the history
  • Loading branch information
mvlabat committed Jan 15, 2022
1 parent 708de90 commit e65d274
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/bevy_ecs/src/query/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ pub trait FetchedItem {
/// # my_system.system();
/// ```
pub trait Fetch<'world, 'state>: Sized {
type Item;
type Item: FetchedItem;
type State: FetchState;

/// Creates a new instance of this fetch.
Expand Down Expand Up @@ -1384,3 +1384,9 @@ impl<'w, 's, State: FetchState> Fetch<'w, 's> for NopFetch<State> {
#[inline(always)]
unsafe fn table_fetch(&mut self, _table_row: usize) -> Self::Item {}
}

/// This implementation won't allow us to correlate a boolean to a filter type. But having a dummy
/// for `bool` allows us to add `FetchedItem` bound to [`Fetch::Item`].
impl FetchedItem for bool {
type Query = ();
}

0 comments on commit e65d274

Please sign in to comment.