Skip to content

Commit 04cdaf7

Browse files
committed
fix_ghost_nodes
1 parent 0f1c7c8 commit 04cdaf7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

crates/bevy_ui/src/experimental/ghost_hierarchy.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ pub struct GhostNode;
2929
///
3030
/// A UI root node is either a [`Node`] without a [`ChildOf`], or with only [`GhostNode`] ancestors.
3131
#[derive(SystemParam)]
32-
pub struct UiRootNodes<'w, 's> {
33-
root_node_query: Query<'w, 's, Entity, (With<Node>, Without<ChildOf>)>,
34-
root_ghost_node_query: Query<'w, 's, Entity, (With<GhostNode>, Without<ChildOf>)>,
35-
all_nodes_query: Query<'w, 's, Entity, With<Node>>,
36-
ui_children: UiChildren<'w, 's>,
32+
pub struct UiRootNodes<'w> {
33+
root_node_query: Query<'w, 'w, Entity, (With<Node>, Without<ChildOf>)>,
34+
root_ghost_node_query: Query<'w, 'w, Entity, (With<GhostNode>, Without<ChildOf>)>,
35+
all_nodes_query: Query<'w, 'w, Entity, With<Node>>,
36+
ui_children: UiChildren<'w>,
3737
}
3838

3939
#[cfg(not(feature = "ghost_nodes"))]
40-
pub type UiRootNodes<'w, 's> = Query<'w, 's, Entity, (With<Node>, Without<ChildOf>)>;
40+
pub type UiRootNodes<'w> = Query<'w, 'w, Entity, (With<Node>, Without<ChildOf>)>;
4141

4242
#[cfg(feature = "ghost_nodes")]
43-
impl<'w, 's> UiRootNodes<'w, 's> {
44-
pub fn iter(&'s self) -> impl Iterator<Item = Entity> + 's {
43+
impl<'w> UiRootNodes<'w> {
44+
pub fn iter(&'w self) -> impl Iterator<Item = Entity> + 'w {
4545
self.root_node_query
4646
.iter()
4747
.chain(self.root_ghost_node_query.iter().flat_map(|root_ghost| {
@@ -54,17 +54,17 @@ impl<'w, 's> UiRootNodes<'w, 's> {
5454
#[cfg(feature = "ghost_nodes")]
5555
/// System param that gives access to UI children utilities, skipping over [`GhostNode`].
5656
#[derive(SystemParam)]
57-
pub struct UiChildren<'w, 's> {
57+
pub struct UiChildren<'w> {
5858
ui_children_query: Query<
5959
'w,
60-
's,
60+
'w,
6161
(Option<&'static Children>, Has<GhostNode>),
6262
Or<(With<Node>, With<GhostNode>)>,
6363
>,
64-
changed_children_query: Query<'w, 's, Entity, Changed<Children>>,
65-
children_query: Query<'w, 's, &'static Children>,
66-
ghost_nodes_query: Query<'w, 's, Entity, With<GhostNode>>,
67-
parents_query: Query<'w, 's, &'static ChildOf>,
64+
changed_children_query: Query<'w, 'w, Entity, Changed<Children>>,
65+
children_query: Query<'w, 'w, &'static Children>,
66+
ghost_nodes_query: Query<'w, 'w, Entity, With<GhostNode>>,
67+
parents_query: Query<'w, 'w, &'static ChildOf>,
6868
}
6969

7070
#[cfg(not(feature = "ghost_nodes"))]
@@ -85,7 +85,7 @@ impl<'w> UiChildren<'w> {
8585
/// # Performance
8686
///
8787
/// This iterator allocates if the `entity` node has more than 8 children (including ghost nodes).
88-
pub fn iter_ui_children(&'w self, entity: Entity) -> UiChildrenIter<'w, 's> {
88+
pub fn iter_ui_children(&'w self, entity: Entity) -> UiChildrenIter<'w> {
8989
UiChildrenIter {
9090
stack: self
9191
.ui_children_query
@@ -105,7 +105,7 @@ impl<'w> UiChildren<'w> {
105105
}
106106

107107
/// Iterates the [`GhostNode`]s between this entity and its UI children.
108-
pub fn iter_ghost_nodes(&'w self, entity: Entity) -> Box<dyn Iterator<Item = Entity> + 's> {
108+
pub fn iter_ghost_nodes(&'w self, entity: Entity) -> Box<dyn Iterator<Item = Entity> + 'w> {
109109
Box::new(
110110
self.children_query
111111
.get(entity)

0 commit comments

Comments
 (0)