Skip to content

Commit

Permalink
Apply rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikeForceZero committed Apr 30, 2024
1 parent 79f3691 commit a0f6e73
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions crates/bevy_ui/src/layout/ui_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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");
Expand All @@ -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));

Expand All @@ -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));
Expand Down

0 comments on commit a0f6e73

Please sign in to comment.