Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Mar 23, 2022
1 parent c61fdc8 commit e49da1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl World {
/// .insert(Position { x: 0.0, y: 0.0 })
/// .id();
///
/// let position = world.entity(entity).entity_ref.get::<Position>().unwrap();
/// let position = world.entity(entity).get::<Position>().unwrap();
/// assert_eq!(position.x, 0.0);
/// ```
#[inline]
Expand Down Expand Up @@ -339,7 +339,7 @@ impl World {
/// .insert_bundle((Num(1), Label("hello"))) // add a bundle of components
/// .id();
///
/// let position = world.entity(entity).entity_ref.get::<Position>().unwrap();
/// let position = world.entity(entity).get::<Position>().unwrap();
/// assert_eq!(position.x, 0.0);
/// ```
pub fn spawn(&mut self) -> EntityMut {
Expand Down Expand Up @@ -416,7 +416,7 @@ impl World {
/// ```
#[inline]
pub fn get<T: Component>(&self, entity: Entity) -> Option<&T> {
self.get_entity(entity)?.get::<T>()
self.get_entity(entity)?.get()
}

/// Retrieves a mutable reference to the given `entity`'s [Component] of the given type.
Expand Down

0 comments on commit e49da1f

Please sign in to comment.