@@ -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
/// - `storage_type` must accurately reflect where the components for `component_id` are stored.
35
34
/// - `Archetypes` and `Components` must come from the world this of this `Storages`
36
35
/// - the caller must ensure that no aliasing rules are violated
@@ -45,6 +44,7 @@ impl Storages {
45
44
location : EntityLocation ,
46
45
) -> Option < ( Ptr < ' _ > , TickCells < ' _ > ) > {
47
46
let component_id = components. get_id ( type_id) ?;
47
+ // SAFETY: component_id is valid, the rest is deferred to caller
48
48
self . get_component_and_ticks ( archetypes, component_id, storage_type, entity, location)
49
49
}
50
50
@@ -88,6 +88,7 @@ impl Storages {
88
88
/// # Safety
89
89
/// - `entity_location` must be within bounds of the given archetype and `entity` must exist inside
90
90
/// the archetype
91
+ /// - `storage_type` must accurately reflect where the components for `component_id` are stored.
91
92
/// - `Archetypes` and `Components` must come from the world this of this `Storages`
92
93
/// - the caller must ensure that no aliasing rules are violated
93
94
#[ inline]
@@ -101,6 +102,7 @@ impl Storages {
101
102
location : EntityLocation ,
102
103
) -> Option < Ptr < ' _ > > {
103
104
let component_id = components. get_id ( type_id) ?;
105
+ // SAFETY: component_id is valid, the rest is deferred to caller
104
106
self . get_component ( archetypes, component_id, storage_type, entity, location)
105
107
}
106
108
@@ -139,6 +141,7 @@ impl Storages {
139
141
/// # Safety
140
142
/// - `entity_location` must be within bounds of the given archetype and `entity` must exist inside
141
143
/// the archetype
144
+ /// - `storage_type` must accurately reflect where the components for `component_id` are stored.
142
145
/// - `Archetypes` and `Components` must come from the world this of this `Storages`
143
146
/// - the caller must ensure that no aliasing rules are violated
144
147
#[ inline]
@@ -152,6 +155,7 @@ impl Storages {
152
155
location : EntityLocation ,
153
156
) -> Option < ComponentTicks > {
154
157
let component_id = components. get_id ( type_id) ?;
158
+ // SAFETY: component_id is valid, the rest is deferred to caller
155
159
self . get_ticks ( archetypes, component_id, storage_type, entity, location)
156
160
}
157
161
0 commit comments