(tree: &Tree<PaneKind>)
| 138 | } |
| 139 | |
| 140 | pub fn pane_tile_map(tree: &Tree<PaneKind>) -> HashMap<PaneKind, TileId> { |
| 141 | let mut ids = HashMap::with_capacity(PaneKind::ALL.len()); |
| 142 | for (tile_id, tile) in tree.tiles.iter() { |
| 143 | if let Tile::Pane(pane) = tile { |
| 144 | ids.insert(*pane, *tile_id); |
| 145 | } |
| 146 | } |
| 147 | ids |
| 148 | } |
| 149 | |
| 150 | pub fn ensure_all_panes(tree: &mut Tree<PaneKind>) -> HashMap<PaneKind, TileId> { |
| 151 | if tree.root.is_none() { |
no outgoing calls