Skip to content

Commit e3ed62b

Browse files
Fixed broken tests; exported ExclusiveSystem trait in prelude
1 parent 1cd180b commit e3ed62b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

crates/bevy_ecs/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pub mod prelude {
2929
Schedule, Stage, StageLabel, State, SystemLabel, SystemSet, SystemStage,
3030
},
3131
system::{
32-
Commands, In, IntoChainSystem, IntoExclusiveSystem, IntoSystem, Local, NonSend,
33-
NonSendMut, Query, QuerySet, RemovedComponents, Res, ResMut, System,
32+
Commands, ExclusiveSystem, In, IntoChainSystem, IntoExclusiveSystem, IntoSystem, Local,
33+
NonSend, NonSendMut, Query, QuerySet, RemovedComponents, Res, ResMut, System,
3434
},
3535
world::{FromWorld, Mut, World},
3636
};

crates/bevy_ecs/src/system/exclusive_system.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub trait ExclusiveSystem: Send + Sync + 'static {
3131
/// }
3232
///
3333
/// world.insert_resource::<Counter>(Counter(0));
34-
/// count_up.exclusive_system().run_direct(world);
34+
/// count_up.exclusive_system().run_direct(&mut world);
3535
/// let counter = world.get_resource::<Counter>().unwrap();
3636
/// assert_eq!(counter.0, 1);
3737
///```
@@ -77,6 +77,11 @@ impl ExclusiveSystem for ExclusiveSystemFn {
7777
world.last_change_tick = saved_last_tick;
7878
}
7979

80+
fn run_direct(&mut self, world: &mut World) {
81+
self.initialize(world);
82+
self.run(world);
83+
}
84+
8085
fn initialize(&mut self, _: &mut World) {}
8186

8287
fn check_change_tick(&mut self, change_tick: u32) {

crates/bevy_ecs/src/system/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub trait System: Send + Sync + 'static {
8888
/// }
8989
///
9090
/// world.insert_resource::<Counter>(Counter(0));
91-
/// count_up.run_direct((), world);
91+
/// count_up.system().run_direct((), &mut world);
9292
/// let counter = world.get_resource::<Counter>().unwrap();
9393
/// assert_eq!(counter.0, 1);
9494
/// ```

0 commit comments

Comments
 (0)