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
@ -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 New Issue
Block a user