mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
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:
parent
2f6c464f4b
commit
cbe9e56d85
1 changed files with 2 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue