Skip to content

Commit 609f38e

Browse files
committed
use world_metadata instead of unsafe_world
1 parent 76e77f6 commit 609f38e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

crates/bevy_ecs/src/world/unsafe_world_cell.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,39 +156,39 @@ impl<'w> UnsafeWorldCell<'w> {
156156
pub fn entities(self) -> &'w Entities {
157157
// SAFETY:
158158
// - we only access world metadata
159-
&unsafe { self.unsafe_world() }.entities
159+
&unsafe { self.world_metadata() }.entities
160160
}
161161

162162
/// Retrieves this world's [Archetypes] collection
163163
#[inline]
164164
pub fn archetypes(self) -> &'w Archetypes {
165165
// SAFETY:
166166
// - we only access world metadata
167-
&unsafe { self.unsafe_world() }.archetypes
167+
&unsafe { self.world_metadata() }.archetypes
168168
}
169169

170170
/// Retrieves this world's [Components] collection
171171
#[inline]
172172
pub fn components(self) -> &'w Components {
173173
// SAFETY:
174174
// - we only access world metadata
175-
&unsafe { self.unsafe_world() }.components
175+
&unsafe { self.world_metadata() }.components
176176
}
177177

178178
/// Retrieves this world's [Bundles] collection
179179
#[inline]
180180
pub fn bundles(self) -> &'w Bundles {
181181
// SAFETY:
182182
// - we only access world metadata
183-
&unsafe { self.unsafe_world() }.bundles
183+
&unsafe { self.world_metadata() }.bundles
184184
}
185185

186186
/// Reads the current change tick of this world.
187187
#[inline]
188188
pub fn read_change_tick(self) -> u32 {
189189
// SAFETY:
190190
// - we only access world metadata
191-
unsafe { self.unsafe_world() }
191+
unsafe { self.world_metadata() }
192192
.change_tick
193193
.load(Ordering::Acquire)
194194
}
@@ -197,14 +197,14 @@ impl<'w> UnsafeWorldCell<'w> {
197197
pub fn last_change_tick(self) -> u32 {
198198
// SAFETY:
199199
// - we only access world metadata
200-
unsafe { self.unsafe_world() }.last_change_tick
200+
unsafe { self.world_metadata() }.last_change_tick
201201
}
202202

203203
#[inline]
204204
pub fn increment_change_tick(self) -> u32 {
205205
// SAFETY:
206206
// - we only access world metadata
207-
unsafe { self.unsafe_world() }
207+
unsafe { self.world_metadata() }
208208
.change_tick
209209
.fetch_add(1, Ordering::AcqRel)
210210
}
@@ -217,7 +217,7 @@ impl<'w> UnsafeWorldCell<'w> {
217217
) -> Option<ArchetypeComponentId> {
218218
// SAFETY:
219219
// - we only access world metadata
220-
let resource = unsafe { self.unsafe_world() }
220+
let resource = unsafe { self.world_metadata() }
221221
.storages
222222
.resources
223223
.get(component_id)?;
@@ -232,7 +232,7 @@ impl<'w> UnsafeWorldCell<'w> {
232232
) -> Option<ArchetypeComponentId> {
233233
// SAFETY:
234234
// - we only access world metadata
235-
let resource = unsafe { self.unsafe_world() }
235+
let resource = unsafe { self.world_metadata() }
236236
.storages
237237
.non_send_resources
238238
.get(component_id)?;

0 commit comments

Comments
 (0)