diff --git a/crates/bevy_ui/src/layout/ui_surface.rs b/crates/bevy_ui/src/layout/ui_surface.rs index 4355575f33ace3..555e60672e527d 100644 --- a/crates/bevy_ui/src/layout/ui_surface.rs +++ b/crates/bevy_ui/src/layout/ui_surface.rs @@ -187,9 +187,7 @@ impl UiSurface { .unwrap(); let parent_taffy = self.entity_to_taffy.get(parent_entity).unwrap(); let child_taffy = self.entity_to_taffy.get(target_entity).unwrap(); - self.taffy - .add_child(*parent_taffy, *child_taffy) - .unwrap(); + self.taffy.add_child(*parent_taffy, *child_taffy).unwrap(); } } @@ -377,16 +375,11 @@ without UI components as a child of an entity with UI components, results may be { let taffy_node = *self.entity_to_taffy.get(&ui_entity).unwrap(); if let Some(parent) = self.taffy.parent(taffy_node) { - self.taffy - .remove_child(parent, taffy_node) - .unwrap(); + self.taffy.remove_child(parent, taffy_node).unwrap(); } self.taffy - .add_child( - root_node_data.implicit_viewport_node, - taffy_node, - ) + .add_child(root_node_data.implicit_viewport_node, taffy_node) .unwrap(); } @@ -587,12 +580,8 @@ mod tests { // assign root node to camera ui_surface.set_camera_children(camera_entity, [root_node_entity].into_iter()); - assert!(ui_surface - .camera_root_nodes - .contains_key(&camera_entity)); - assert!(ui_surface - .root_node_data - .contains_key(&root_node_entity)); + assert!(ui_surface.camera_root_nodes.contains_key(&camera_entity)); + assert!(ui_surface.root_node_data.contains_key(&root_node_entity)); let _root_node_data = ui_surface .get_root_node_data(root_node_entity) .expect("expected root node data"); @@ -608,9 +597,7 @@ mod tests { assert!(ui_surface.entity_to_taffy.contains_key(&root_node_entity)); // `camera_roots` and `camera_entity_to_taffy` should no longer contain entries for `camera_entity` - assert!(!ui_surface - .camera_root_nodes - .contains_key(&camera_entity)); + assert!(!ui_surface.camera_root_nodes.contains_key(&camera_entity)); assert!(!ui_surface.camera_root_nodes.contains_key(&camera_entity)); @@ -636,9 +623,7 @@ mod tests { .get(&camera_entity) .unwrap() .contains(&root_node_entity)); - let _root_node_data = ui_surface - .get_root_node_data(root_node_entity) - .unwrap(); + let _root_node_data = ui_surface.get_root_node_data(root_node_entity).unwrap(); ui_surface.remove_entities([root_node_entity]); assert!(!ui_surface.entity_to_taffy.contains_key(&root_node_entity));