diff --git a/crates/bevy_scene/src/dynamic_scene_builder.rs b/crates/bevy_scene/src/dynamic_scene_builder.rs index 4592569afa8aa..f850b328b410a 100644 --- a/crates/bevy_scene/src/dynamic_scene_builder.rs +++ b/crates/bevy_scene/src/dynamic_scene_builder.rs @@ -78,10 +78,8 @@ impl<'w> DynamicSceneBuilder<'w> { /// /// These were likely created because none of their components were present in the provided type registry upon extraction. pub fn remove_empty_entities(&mut self) -> &mut Self { - self.extracted_scene = self - .extracted_scene - .drain_filter(|_, entity| !entity.components.is_empty()) - .collect(); + self.extracted_scene + .retain(|_, entity| !entity.components.is_empty()); self }