Enhancement over Rust's std::collections::BinaryHeap
.
It supports the following features and still maintains backward compatibility.
- Max heap
- Min heap
- Heap ordered by closure
- Heap ordered by key generated by closure
This crate requires Rust 1.26 or later.
Currently, the From<Vec<T>>
trait is implemented for max heap only.
If you add generic impl for other heaps, the existing code breaks, requires
slight modification such as type annotation.
To maintain good compatibility with std
version, ::from_vec()
method was added
for the same purpose.
- [COMPATIBILITY CHANGE] Use
Compare
trait fromcompare
crate instead of our own definition. Most users should not be affected by this. TIP: ExternalCompare<T>
impls needs to be updated to useFn
instead ofFnMut
. - [COMPATIBILITY CHANGE] rename feature
serde1
toserde
in order to comply with the guideline: https://rust-lang-nursery.github.io/api-guidelines/interoperability.html#c-serde - Refactor ctor impl.
- Add generic constructor
from_vec()
andfrom_vec_cmp()
. - Refactor other ctor to call above methods.
- Add
serde1
feature which adds Serialize/Deserialize
- Merge #1) Do not require T: Ord when a custom comparator is provided
- Add comprehensive CI based on
trust
CI template v0.1.2 - README.md tweaks.
- Cargo.toml tweaks
- I received many valuable feedback from Pre-RFC thread [1].
- The current design is based on @ExpHP's suggestion that compiles on stable compiler.
- DDOtten, steven099, CAD97, ExpHP, scottmcm, Nemo157 and gnzlbg, thanks for looking into the design!
- @ulysseB sent me a first pull request!
- @inesseq contributed feature
serde1
.
See the following discussions for the background of the crate: