Skip to content

Commit d5835c1

Browse files
Fixed broken tests
1 parent aa07241 commit d5835c1

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
@@ -32,7 +32,7 @@ pub trait ExclusiveSystem: Send + Sync + 'static {
3232
/// }
3333
///
3434
/// world.insert_resource::<Counter>(Counter(0));
35-
/// count_up.exclusive_system().run_direct(world);
35+
/// count_up.exclusive_system().run_direct(&mut world);
3636
/// let counter = world.get_resource::<Counter>().unwrap();
3737
/// assert_eq!(counter.0, 1);
3838
///```
@@ -78,6 +78,11 @@ impl ExclusiveSystem for ExclusiveSystemFn {
7878
world.last_change_tick = saved_last_tick;
7979
}
8080

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

8388
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)