@@ -30,7 +30,6 @@ impl Storages {
30
30
///
31
31
/// # Safety
32
32
/// - `entity_location` must be within bounds of the given archetype and `entity` must exist inside
33
- /// - `component_id` must be valid
34
33
/// - `Archetypes` and `Components` must come from the world this of this `Storages`
35
34
/// - the caller must ensure that no aliasing rules are violated
36
35
#[ inline]
@@ -43,6 +42,7 @@ impl Storages {
43
42
location : EntityLocation ,
44
43
) -> Option < ( Ptr < ' _ > , & UnsafeCell < ComponentTicks > ) > {
45
44
let component_id = components. get_id ( type_id) ?;
45
+ // SAFETY: component_id is valid, the rest is deferred to caller
46
46
self . get_component_and_ticks ( archetypes, components, component_id, entity, location)
47
47
}
48
48
@@ -102,6 +102,7 @@ impl Storages {
102
102
location : EntityLocation ,
103
103
) -> Option < Ptr < ' _ > > {
104
104
let component_id = components. get_id ( type_id) ?;
105
+ // SAFETY: component_id is valid, the rest is deferred to caller
105
106
self . get_component ( archetypes, components, component_id, entity, location)
106
107
}
107
108
@@ -157,6 +158,7 @@ impl Storages {
157
158
location : EntityLocation ,
158
159
) -> Option < & UnsafeCell < ComponentTicks > > {
159
160
let component_id = components. get_id ( type_id) ?;
161
+ // SAFETY: component_id is valid, the rest is deferred to caller
160
162
self . get_ticks ( archetypes, components, component_id, entity, location)
161
163
}
162
164
0 commit comments