Skip to content

Commit

Permalink
Make boxed conditions read-only (bevyengine#7786)
Browse files Browse the repository at this point in the history
# Objective

The `BoxedCondition` type alias does not require the underlying system to be read-only.

## Solution

Define the type alias using `ReadOnlySystem` instead of `System`.
  • Loading branch information
JoJoJet authored and Shfty committed Mar 19, 2023
1 parent 49b9bed commit f969a06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/schedule/condition.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::borrow::Cow;

use crate::system::{BoxedSystem, CombinatorSystem, Combine, IntoSystem, System};
use crate::system::{CombinatorSystem, Combine, IntoSystem, ReadOnlySystem, System};

pub type BoxedCondition = BoxedSystem<(), bool>;
pub type BoxedCondition = Box<dyn ReadOnlySystem<In = (), Out = bool>>;

/// A system that determines if one or more scheduled systems should run.
///
Expand Down

0 comments on commit f969a06

Please sign in to comment.