mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
Fix an incorrect safety comment in World::get_resource
(#6764)
# Objective * Fix #6307 ## Solution * Rewrite the safety comment to reflect the actual invariants being asserted.
This commit is contained in:
parent
70d7f80564
commit
1615834536
1 changed files with 1 additions and 1 deletions
|
@ -889,7 +889,7 @@ impl World {
|
|||
#[inline]
|
||||
pub fn get_resource<R: Resource>(&self) -> Option<&R> {
|
||||
let component_id = self.components.get_resource_id(TypeId::of::<R>())?;
|
||||
// SAFETY: unique world access
|
||||
// SAFETY: `component_id` was obtained from the type ID of `R`.
|
||||
unsafe { self.get_resource_with_id(component_id) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue