Skip to content

Commit

Permalink
Add IntoIterator implementation for RemovedComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
oceantume committed Sep 5, 2022
1 parent ad4bb13 commit af118ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,15 @@ impl<'a, T: Component> RemovedComponents<'a, T> {
}
}

impl<'a, T: Component> IntoIterator for &'a RemovedComponents<'a, T> {
type Item = Entity;
type IntoIter = std::iter::Cloned<std::slice::Iter<'a, Entity>>;

fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}

// SAFETY: Only reads World components
unsafe impl<T: Component> ReadOnlySystemParamFetch for RemovedComponentsState<T> {}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/flex/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ pub fn flex_node_system(
}

// clean up removed nodes
flex_surface.remove_entities(removed_nodes.iter());
flex_surface.remove_entities(&removed_nodes);

// update window children (for now assuming all Nodes live in the primary window)
if let Some(primary_window) = windows.get_primary() {
Expand Down

0 comments on commit af118ae

Please sign in to comment.