Skip to content

Commit 7f9588d

Browse files
authored
Fix documentation of Entities::get (#17721)
This method returns `None` if `meta.location.archetype_id` is `ArchetypeId::INVALID`. `EntityLocation::INVALID.archetype_id` is `ArchetypeId::INVALID`. Therefore this method cannot return `Some(EntityLocation::INVALID)`. Linking to it in the docs is futile anyway as that constant is not public.
1 parent 8435951 commit 7f9588d

File tree

1 file changed

+1
-1
lines changed
  • crates/bevy_ecs/src/entity

1 file changed

+1
-1
lines changed

crates/bevy_ecs/src/entity/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl Entities {
830830
}
831831

832832
/// Returns the location of an [`Entity`].
833-
/// Note: for pending entities, returns `Some(EntityLocation::INVALID)`.
833+
/// Note: for pending entities, returns `None`.
834834
#[inline]
835835
pub fn get(&self, entity: Entity) -> Option<EntityLocation> {
836836
if let Some(meta) = self.meta.get(entity.index() as usize) {

0 commit comments

Comments
 (0)