Add `ApplyCommands` (#6184)
Objective
Fixed #6184
Solution
This PR adds an ApplyCommands trait which is implemented for &mut World and &mut App. It allows the user to do this:
let mut world = World::default();
let _ = world.apply_commands(|_world, mut commands| {
/* ... */
});
Initially this PR was posted as #6186. I accidentally deleted the repo, so this is the replacement.
I also took this chance to rename Execute to ApplyCommands because I think it matches better with existing terminology, and simplified how_to_test_commands.rs.
As a heads up, I just added Schedule::apply_system_buffers in #7267 (because pipelined rendering needs it). We should wait and see how that shakes out, and then decide whether this is still needed post-Stageless.
This is no longer blocked!
Not sure what's going on with the validation here. This is already moved to bevy_ecs.
Yeah pushing a new commit will probably reset CI: we changed it quite a bit (to remove bors) since your last push.
@alice-i-cecile Is there anything blocking the integration of this from my end? As far as I can tell all the review concerns have been addressed.
Closing in favor of run_system based on feedback.