Closed nagisa closed 7 years ago
The API is a bit all over the place, but Heap
is a lazy iterator that can be stepped as far as you want. I guess it has that weird check that the input array/slice is short enough though, that could be changed.
Using the funky ControlFlow thing from here https://docs.rs/petgraph/0.3.2/petgraph/visit/trait.ControlFlow.html makes it Zero CostTM
Fixed
Currently there’s no way to terminate heap_recursive early from the callback. Returning a bool from the closure could be an easy way to do it.