Skip to content

Commit

Permalink
Fixes to World's documentation (bevyengine#2790)
Browse files Browse the repository at this point in the history
# Objective

Fixes bevyengine#2787.

## Solution

Fixed doc syntax for `World`'s `get` and `get_mut` methods.
  • Loading branch information
willolisp committed Sep 9, 2021
1 parent 2f6c464 commit cbe9e56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ impl World {
/// .id();
/// let position = world.get::<Position>(entity).unwrap();
/// assert_eq!(position.x, 0.0);
/// ```
#[inline]
pub fn get<T: Component>(&self, entity: Entity) -> Option<&T> {
self.get_entity(entity)?.get()
Expand All @@ -404,6 +405,7 @@ impl World {
/// .id();
/// let mut position = world.get_mut::<Position>(entity).unwrap();
/// position.x = 1.0;
/// ```
#[inline]
pub fn get_mut<T: Component>(&mut self, entity: Entity) -> Option<Mut<T>> {
self.get_entity_mut(entity)?.get_mut()
Expand Down

0 comments on commit cbe9e56

Please sign in to comment.