Skip to content

Commit 436dbd1

Browse files
Fixed broken tests
1 parent eb9ad8d commit 436dbd1

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

crates/bevy_ecs/src/lib.rs

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

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)