Skip to content

Commit 2f2c31c

Browse files
committed
back out an over-aggressive find/replace
1 parent a77b366 commit 2f2c31c

File tree

2 files changed

+7
-7
lines changed
  • crates

2 files changed

+7
-7
lines changed

crates/bevy_ecs/src/world/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ impl World {
657657
///
658658
/// This is useful in contexts where you only have read-only access to the [`World`].
659659
#[inline]
660-
pub fn visit_entities(&self) -> impl Iterator<Item = EntityRef<'_>> + '_ {
660+
pub fn iter_entities(&self) -> impl Iterator<Item = EntityRef<'_>> + '_ {
661661
self.archetypes.iter().flat_map(|archetype| {
662662
archetype
663663
.entities()
@@ -685,7 +685,7 @@ impl World {
685685
}
686686

687687
/// Returns a mutable iterator over all entities in the `World`.
688-
pub fn visit_entities_mut(&mut self) -> impl Iterator<Item = EntityMut<'_>> + '_ {
688+
pub fn iter_entities_mut(&mut self) -> impl Iterator<Item = EntityMut<'_>> + '_ {
689689
let world_cell = self.as_unsafe_world_cell();
690690
world_cell.archetypes().iter().flat_map(move |archetype| {
691691
archetype
@@ -3396,7 +3396,7 @@ mod tests {
33963396

33973397
let iterate_and_count_entities = |world: &World, entity_counters: &mut HashMap<_, _>| {
33983398
entity_counters.clear();
3399-
for entity in world.visit_entities() {
3399+
for entity in world.iter_entities() {
34003400
let counter = entity_counters.entry(entity.id()).or_insert(0);
34013401
*counter += 1;
34023402
}
@@ -3473,7 +3473,7 @@ mod tests {
34733473
let b1 = world.spawn(B(1)).id();
34743474
let b2 = world.spawn(B(2)).id();
34753475

3476-
for mut entity in world.visit_entities_mut() {
3476+
for mut entity in world.iter_entities_mut() {
34773477
if let Some(mut a) = entity.get_mut::<A>() {
34783478
a.0 -= 1;
34793479
}
@@ -3483,7 +3483,7 @@ mod tests {
34833483
assert_eq!(world.entity(b1).get(), Some(&B(1)));
34843484
assert_eq!(world.entity(b2).get(), Some(&B(2)));
34853485

3486-
for mut entity in world.visit_entities_mut() {
3486+
for mut entity in world.iter_entities_mut() {
34873487
if let Some(mut b) = entity.get_mut::<B>() {
34883488
b.0 *= 2;
34893489
}
@@ -3493,7 +3493,7 @@ mod tests {
34933493
assert_eq!(world.entity(b1).get(), Some(&B(2)));
34943494
assert_eq!(world.entity(b2).get(), Some(&B(4)));
34953495

3496-
let mut entities = world.visit_entities_mut().collect::<Vec<_>>();
3496+
let mut entities = world.iter_entities_mut().collect::<Vec<_>>();
34973497
entities.sort_by_key(|e| e.get::<A>().map(|a| a.0).or(e.get::<B>().map(|b| b.0)));
34983498
let (a, b) = entities.split_at_mut(2);
34993499
core::mem::swap(

crates/bevy_render/src/render_phase/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ where
766766

767767
/// An [`Iterator`] through the associated [`Entity`] for each [`PhaseItem`] in order.
768768
#[inline]
769-
pub fn visit_entities(&'_ self) -> impl Iterator<Item = Entity> + '_ {
769+
pub fn iter_entities(&'_ self) -> impl Iterator<Item = Entity> + '_ {
770770
self.items.iter().map(PhaseItem::entity)
771771
}
772772

0 commit comments

Comments
 (0)