Skip to content

Commit 6e7c9e6

Browse files
committed
Move safety comment
1 parent f011fea commit 6e7c9e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/bevy_ecs/src/world/entity_ref.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ impl<'w> EntityRef<'w> {
149149
// - entity location and entity is valid
150150
// - returned component is of type T
151151
// - the storage type provided is correct for T
152-
// - Caller guarentees that this reference will not alias.
153152
get_component_and_ticks_with_type(
154153
self.world,
155154
TypeId::of::<T>(),
@@ -158,6 +157,9 @@ impl<'w> EntityRef<'w> {
158157
self.location,
159158
)
160159
.map(|(value, ticks)| Mut {
160+
// SAFETY:
161+
// - returned component is of type T
162+
// - Caller guarentees that this reference will not alias.
161163
value: value.assert_unique().deref_mut::<T>(),
162164
ticks: Ticks::from_tick_cells(ticks, last_change_tick, change_tick),
163165
})

0 commit comments

Comments
 (0)