Skip to content

Commit 80babbf

Browse files
committed
Remove spawn_and_forget
It's unused, and was only ever needed for the weird extract logic Remove the trick because it's actually stupid
1 parent 36e9b12 commit 80babbf

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

crates/bevy_ecs/src/system/commands/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ impl<'w, 's> Commands<'w, 's> {
118118
}
119119
}
120120

121-
/// Spawns a [`Bundle`] without pre-allocating an [`Entity`]. The [`Entity`] will be allocated
122-
/// when this [`Command`] is applied.
123-
pub fn spawn_and_forget(&mut self, bundle: impl Bundle) {
124-
self.queue.push(Spawn { bundle });
125-
}
126-
127121
/// Creates a new entity with the components contained in `bundle`.
128122
///
129123
/// This returns an [`EntityCommands`] builder, which enables inserting more components and

crates/bevy_render/src/extract_param.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::MainWorld;
22
use bevy_ecs::{
33
prelude::*,
4-
system::{
5-
ReadOnlySystemParamFetch, SystemParam, SystemParamFetch, SystemParamItem, SystemState,
6-
},
4+
system::{ReadOnlySystemParamFetch, SystemParam, SystemParamItem, SystemState},
75
};
86

97
pub struct MainWorldState<P: SystemParam>(SystemState<P>);
@@ -19,11 +17,8 @@ pub struct Extract<'w, 's, P: SystemParam + 'static>
1917
where
2018
P::Fetch: ReadOnlySystemParamFetch,
2119
{
22-
state: Local<
23-
's,
24-
MainWorldState<<<P as SystemParam>::Fetch as SystemParamFetch<'static, 'static>>::Item>,
25-
>,
26-
world: Res<'w, World>,
20+
state: Local<'s, MainWorldState<P>>,
21+
world: Res<'w, MainWorld>,
2722
}
2823

2924
impl<'w, 's, P: SystemParam + 'static> Extract<'w, 's, P>

crates/bevy_render/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ fn extract(app_world: &mut World, render_app: &mut App) {
313313
// temporarily add the app world to the render world as a resource
314314
let scratch_world = app_world.remove_resource::<ScratchMainWorld>().unwrap();
315315
let inserted_world = std::mem::replace(app_world, scratch_world.0);
316-
let mut running_world = &mut render_app.world;
316+
let running_world = &mut render_app.world;
317317
running_world.insert_resource(MainWorld(inserted_world));
318318

319-
extract.run(&mut running_world);
320-
extract.apply_buffers(&mut running_world);
319+
extract.run(running_world);
320+
extract.apply_buffers(running_world);
321321

322322
// move the app world back, as if nothing happened.
323323
let inserted_world = running_world.remove_resource::<MainWorld>().unwrap();

0 commit comments

Comments
 (0)