Document EntityMut::remove() (#6168)

# Objective

- Fixes #5990

## Solution

- Add docs for `EntityMut::remove()` explaining its return value.
This commit is contained in:
Kewei Huang 2022-10-05 12:21:09 +00:00
parent 29098b7a11
commit 2a6b544a0a

View file

@ -277,6 +277,9 @@ impl<'w> EntityMut<'w> {
} }
// TODO: move to BundleInfo // TODO: move to BundleInfo
/// Removes a [`Bundle`] of components from the entity and returns the bundle.
///
/// Returns `None` if the entity does not contain the bundle.
pub fn remove<T: Bundle>(&mut self) -> Option<T> { pub fn remove<T: Bundle>(&mut self) -> Option<T> {
let archetypes = &mut self.world.archetypes; let archetypes = &mut self.world.archetypes;
let storages = &mut self.world.storages; let storages = &mut self.world.storages;