Skip to content

Commit 79476e1

Browse files
committed
Make guidance simpler.
1 parent f8b1f4c commit 79476e1

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@
44

55
Enhancement over Rust's `std::collections::BinaryHeap`.
66

7-
It supports the following features and still maintains backward compatibility.
7+
It supports the following heaps and still maintains backward compatibility.
88
- Max heap
9+
- Use `BinaryHeap::new()` or `::with_capacity()`
910
- Min heap
11+
- Use `BinaryHeap::new_min()` or `::with_capacity_min()`
1012
- Heap ordered by closure
13+
- Use `BinaryHeap::new_by()` or `::with_capacity_by()`
1114
- Heap ordered by key generated by closure
15+
- Use `BinaryHeap::new_by_key()` or `::with_capacity_by_key()`
1216

13-
Notable added method is:
14-
- `.into_iter_sorted()` backported from `std`.
17+
Other notable added methods are:
18+
- `BinaryHeap::from_vec_cmp()` and `BinaryHeap::from_vec()` for more generic construction.
19+
- `.into_iter_sorted()` which is less-surprising version of `.into_iter()`. The implementation is backported from `std`.
1520

1621
## MSRV (Minimum Supported Rust Version)
1722

1823
This crate requires Rust 1.31.1 or later.
1924

20-
## Note on `BinaryHeap::from_vec()`
21-
22-
Currently, the `From<Vec<T>>` trait is implemented for max heap only.
23-
If you add generic impl for other heaps, the existing code breaks, requires
24-
slight modification such as type annotation.
25-
26-
To maintain good compatibility with `std` version, `::from_vec()` method was added
27-
for the same purpose.
28-
2925
# Changes
3026

3127
See CHANGELOG.md.

0 commit comments

Comments
 (0)