Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add despawn_recursive to EntityMut #2855

Conversation

TheRawMeatball
Copy link
Member

@TheRawMeatball TheRawMeatball commented Sep 22, 2021

No description provided.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Sep 22, 2021
@alice-i-cecile alice-i-cecile added A-Transform Translations, rotations and scales C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled labels Sep 22, 2021
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 22, 2021
/// Despawns the provided entity and its children.
fn despawn_recursive(mut self) {
let entity = self.id();
unsafe {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a // SAFE: rationale comment above it explaining why this is safe in relationship to the requirements of self.world_mut() (ex: EntityMut is consumed so even though the location is no longer valid, it cannot be accessed again with the invalid location).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just copy that rationale in.

@cart
Copy link
Member

cart commented Sep 28, 2021

bors r+

bors bot pushed a commit that referenced this pull request Sep 28, 2021
@bors bors bot changed the title Add despawn_recursive to EntityMut [Merged by Bors] - Add despawn_recursive to EntityMut Sep 28, 2021
@bors bors bot closed this Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Transform Translations, rotations and scales C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants