Optimized access, cleaned up binding flow
@@ -31,15 +31,14 @@ impl LayoutTree {
}
}
ContainerType::Output => {
- let (geometry, actual_geometry) = {
- let container = &self.tree[node_ix];
- let geometry = container.get_geometry()
+ let geometry;
+ {
+ let container = &mut self.tree[node_ix];
+ geometry = container.get_geometry()
.expect("Output had no geometry");
let actual_geometry = container.get_actual_geometry()
.expect("Output had no actual geometry");
- (geometry, actual_geometry)
- };
- match self.tree[node_ix] {
+ match *container {
Container::Output { ref mut background, .. } => {
// update the background size
if let Some(background) = *background {
@@ -48,6 +47,7 @@ impl LayoutTree {
}
_ => unreachable!()
}
+ }
let mut fullscreen_apps = Vec::new();
for workspace_ix in self.tree.children_of(node_ix) {
self.layout_helper(workspace_ix, geometry, &mut fullscreen_apps);
