Slight cleanup in focus_on_next_container
@@ -135,11 +135,8 @@ impl LayoutTree {
/// tree until either a view is found or the workspace is (in which case
/// it set the active container to the root container of the workspace)
pub fn focus_on_next_container(&mut self, mut parent_ix: NodeIndex) {
- let last_ix;
- {
- let path = self.tree.active_path();
- last_ix = path[path.len() - 1].0;
- }
+ let last_ix = self.tree.active_path().last()
+ .expect("Active path did not lead anywhere").0;
match self.tree[last_ix] {
Container::View { handle, .. } => {
handle.focus();
