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