Skip to content

Commit c6776a5

Browse files
maniwanijoseph-gio
andauthored
Apply suggestions from code review
Co-authored-by: JoJoJet <[email protected]>
1 parent 3576b10 commit c6776a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/bevy_ecs/src/world/entity_ref.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,10 @@ impl<'w> EntityMut<'w> {
281281

282282
/// Removes the components in the [`Bundle`] from the entity and returns their previous values.
283283
///
284-
/// **Note:** This will not remove any components and will return `None` if the entity does not
285-
/// have all components in the bundle.
284+
/// **Note:** If the entity does not have every component in the bundle,
285+
/// this method will not remove any of them.
286286
// TODO: BundleRemover?
287+
#[must_use]
287288
pub fn take<T: Bundle>(&mut self) -> Option<T> {
288289
let archetypes = &mut self.world.archetypes;
289290
let storages = &mut self.world.storages;
@@ -409,7 +410,7 @@ impl<'w> EntityMut<'w> {
409410
entities.set(entity.index(), new_location);
410411
}
411412

412-
/// Removes the components in the [`Bundle`] from the entity.
413+
/// Removes any components in the [`Bundle`] from the entity.
413414
// TODO: BundleRemover?
414415
pub fn remove<T: Bundle>(&mut self) {
415416
let archetypes = &mut self.world.archetypes;

0 commit comments

Comments
 (0)