Skip to content

Commit

Permalink
Update crates/bevy_ecs/src/world/entity_ref.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Alice Cecile <[email protected]>
  • Loading branch information
dmyyy and alice-i-cecile authored May 30, 2024
1 parent fad544d commit 73d35b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_ecs/src/world/entity_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ impl<'w> EntityWorldMut<'w> {
///
/// Allows you to clean-up all components associated with the entity without removing it from the world.
pub fn clear(&mut self) {
// We must collect here to appease the borrow checker
let components: Vec<ComponentId> = self.archetype().components().collect();
for component_id in components {
self.remove_by_id(component_id);
Expand Down

0 comments on commit 73d35b9

Please sign in to comment.