Skip to content

Commit

Permalink
Fix documentation of Entities::get (#17721)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
urben1680 authored Feb 10, 2025
1 parent 8435951 commit 7f9588d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ impl Entities {
}

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

0 comments on commit 7f9588d

Please sign in to comment.