Skip to content

Commit

Permalink
Rename RemovedComponents::iter/iter_with_id to read/read_with_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Indy2222 committed Jan 25, 2024
1 parent e39de43 commit cad0d66
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/gui/src/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn focus_system(
let mut current = focus.current;

if let Some(current_entity) = current {
if removals.iter().any(|e| e == current_entity) {
if removals.read().any(|e| e == current_entity) {
current = None;
}
}
Expand All @@ -123,7 +123,7 @@ fn focus_system(
}

if let Some(previous_entity) = focus.previous {
if removals.iter().any(|e| e == previous_entity) {
if removals.read().any(|e| e == previous_entity) {
focus.previous = None;
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/index/src/precise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn insert(
}

fn remove(mut index: ResMut<EntityIndex>, mut removed: RemovedComponents<Indexed>) {
for entity in removed.iter() {
for entity in removed.read() {
index.remove(entity);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pathing/src/fplugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fn check_removed(
mut state: ResMut<UpdateFinderState>,
mut removed: RemovedComponents<StaticSolid>,
) {
if removed.iter().next().is_some() {
if removed.read().next().is_some() {
state.invalidate();
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pathing/src/pplugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ fn remove_path_targets(
targets: Query<&PathTarget>,
mut removed: RemovedComponents<ScheduledPath>,
) {
for entity in removed.iter() {
for entity in removed.read() {
if let Ok(target) = targets.get(entity) {
if !target.permanent() {
commands.entity(entity).remove::<PathTarget>();
Expand Down
2 changes: 1 addition & 1 deletion crates/signs/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn owner_despawn(
mut lines: ResMut<LineEntities>,
mut removed: RemovedComponents<Active>,
) {
for owner in removed.iter() {
for owner in removed.read() {
if let Some(line) = lines.0.remove(&owner) {
commands.entity(line).despawn_recursive();
}
Expand Down
2 changes: 1 addition & 1 deletion crates/signs/src/pole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fn despawned(
mut owner_to_pole: ResMut<OwnersToPoles>,
mut despawned: RemovedComponents<ObjectTypeComponent>,
) {
for entity in despawned.iter() {
for entity in despawned.read() {
owner_to_pole.0.remove(&entity);
}
}
Expand Down

0 comments on commit cad0d66

Please sign in to comment.