Open enomado opened 1 month ago
Currently i use something like
.iter_all_tabs()
.find_map(|(loc, itab)| (itab.variant == tab).then_some(loc));
.iter_all_nodes()
.enumerate()
.find_map(|(node_idx, (surface_index, node))| {
node.iter_tabs().enumerate().find_map(|(tab_index, itab)| {
(itab.variant == tab).then_some((surface_index, NodeIndex(node_idx), TabIndex(tab_index)))
})
});
Current api is like
Iterator<Item = (SurfaceIndex, &Node<Tab>)>
whith is not very practical. better to return
Iterator<Item = (SurfaceIndex, NodeIndex)>
and
Iterator<Item = (SurfaceIndex, NodeIndex, TabIndex)>
Because all operations(focusing) is performed with indexes.
BTW
My case is search to find node by part of it(since Node must have id, find_tab is almost useless), so I was forced to re-create that iterators in my code.
We could actually merge
find_tab
anditer_all_nodes
with "index api"