pub trait BinaryHeapExt<T> {
    fn retain_ext<F: FnMut(&T) -> bool>(&mut self, f: F);
}
Expand description

Implementation of BinaryHeap::retain that doesn’t require Nightly

Required Methods§

Remove all elements for which f returns false

Performance is not great right now - the algorithm is O(n*log(n)) where n is the number of elements in the heap (not the number removed).

The name is retain_ext to avoid a name collision with the unstable function, which would require the use of UFCS and make this unergonomic.

Implementations on Foreign Types§

Implementors§