Skip to content

Commit bbf5534

Browse files
authored
Merge pull request sekineh#34 from clint-white/rust-1.62.0
Synchronize with Rust 1.62.0
2 parents 1eb3cd5 + 8f153a3 commit bbf5534

File tree

7 files changed

+786
-419
lines changed

7 files changed

+786
-419
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ jobs:
1616
- macos-latest
1717
rust:
1818
- stable
19-
- 1.36.0 # MSRV (Rust 2018 and dev-dependency `serde_json`)
19+
- 1.52.0 # MSRV
2020
cargo_args:
2121
- ""
2222
- --features serde
2323
include:
24+
# Also test on nightly and Rust versions between MSRV and stable
25+
# where there is conditional compilation
2426
- os: ubuntu-latest
2527
rust: nightly
2628
cargo_args: ""
29+
- os: ubuntu-latest
30+
rust: 1.56.0
31+
cargo_args: ""
2732

2833
runs-on: ${{ matrix.os }}
2934

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
11+
* `#[must_use]` attribute to many methods, porting and extending several
12+
rust-lang/rust PRs
13+
* Method `shrink_to()` for Rust 1.56.0 and greater, ported from rust-lang/rust
14+
* Implementation of `From<[T; N]>` for `BinaryHeap<T>` for Rust 1.56.0 or
15+
greater, ported from rust-lang/rust#84111
16+
* Links to referenced items in the documenation
17+
* Example of a min-heap, ported from rust-lang/rust#60451
18+
* Documentation of time complexities of several methods, ported from
19+
rust-lang/rust#60952
20+
921
### Changed
1022

11-
* Bump MSRV (minimum supported rust version) to rust 1.36.0.
23+
* Bump MSRV (minimum supported rust version) to rust 1.52.0.
24+
* Implement `From<BinaryHeap<T, C>>` for `Vec<T>` instead of `Into<Vec<T>>` for
25+
`BinaryHeap<T, C>`
26+
* Port rust-lang/rust#77435 improvement to rebuild heuristic of
27+
`BinaryHeap::append()`
28+
* Use italics with big-O notation in documentation, ported from
29+
rust-lang/rust#71167
30+
* Relax trait bound `C: Compare<T>` on `BinaryHeap<T, C>` struct and certain
31+
methods, in part ported from rust-lang/rust#58421
32+
* Synchronize internal implementation details with
33+
`std::collections::BinaryHeap` in Rust 1.62.0
1234

1335
## [0.4.1] - 2021-01-06
1436

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ keywords = ["binary", "heap", "priority", "queue"]
1010
categories = ["data-structures", "algorithms", ]
1111
edition = "2018"
1212

13+
[build-dependencies]
14+
autocfg = "1"
15+
1316
[dependencies]
1417
compare = "0.1.0"
1518
serde = { version = "1.0.116", optional = true, features = ["derive"] }

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
![Rust](https://github.com/sekineh/binary-heap-plus-rs/workflows/Rust/badge.svg)
44

5-
Enhancement over Rust's `std::collections::BinaryHeap`.
5+
Enhancement over Rust's
6+
[`std::collections::BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html).
67

78
It supports the following heaps and still maintains backward compatibility.
89
- Max heap
@@ -19,14 +20,20 @@ Other notable added methods are:
1920
- `.into_iter_sorted()` which is less-surprising version of `.into_iter()`. The implementation is backported from `std`.
2021
- `.replace_cmp()` which replace the comparator of the existing heap.
2122

22-
## MSRV (Minimum Supported Rust Version)
23+
## Compatibility and MSRV (Minimum Supported Rust Version)
2324

24-
This crate requires Rust 1.36.0 or later.
25+
This crate is based on the standard library's implementation of
26+
[`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html)
27+
from Rust 1.62.0.
28+
29+
This crate requires Rust 1.52.0 or later. A few of its APIs are only available
30+
for more recent versions of Rust where they have been stabilized in the
31+
standard library; see the documentation for specifics.
2532

2633
# Changes
2734

28-
See CHANGELOG.md.
29-
https://github.com/sekineh/binary-heap-plus-rs/blob/master/CHANGELOG.md
35+
See
36+
[CHANGELOG.md](https://github.com/sekineh/binary-heap-plus-rs/blob/master/CHANGELOG.md).
3037

3138
# Thanks
3239

build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let ac = autocfg::new();
3+
4+
// Required for stabilization of `Vec::shrink_to()` and `IntoIterator` for arrays.
5+
ac.emit_rustc_version(1, 56);
6+
7+
autocfg::rerun_path("build.rs");
8+
}

0 commit comments

Comments
 (0)