From a0f6e739cf6aa0ee842006f3a21e0e71b1764b90 Mon Sep 17 00:00:00 2001 From: bstriker Date: Tue, 30 Apr 2024 13:49:21 -0400 Subject: [PATCH] Apply rustfmt --- crates/bevy_ui/src/layout/ui_surface.rs | 29 ++++++------------------- 1 file changed, 7 insertions(+), 22 deletions(-) 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));