Fixes to World's documentation (#2790)

# Objective

Fixes #2787.

## Solution

Fixed doc syntax for `World`'s `get` and `get_mut` methods.
This commit is contained in:
willolisp 2021-09-09 12:26:43 +00:00
parent 2f6c464f4b
commit cbe9e56d85

View file

@ -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()
@ -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()