Skip to content

Commit 52a20d8

Browse files
committed
Migrate to Rust 2021 Edition
- Change edition to 2021 - Increase MSRV to 1.56.0 - Remove `build.rs`, build-dependency on `autocfg`, and conditional compilation of methods requiring at least 1.56.0 - Update the CI matrix
1 parent bbf5534 commit 52a20d8

File tree

6 files changed

+9
-36
lines changed

6 files changed

+9
-36
lines changed

.github/workflows/rust.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,14 @@ jobs:
1616
- macos-latest
1717
rust:
1818
- stable
19-
- 1.52.0 # MSRV
19+
- 1.56.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
2624
- os: ubuntu-latest
2725
rust: nightly
2826
cargo_args: ""
29-
- os: ubuntu-latest
30-
rust: 1.56.0
31-
cargo_args: ""
3227

3328
runs-on: ${{ matrix.os }}
3429

CHANGELOG.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
* `#[must_use]` attribute to many methods, porting and extending several
1212
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
13+
* Method `shrink_to()`, ported from rust-lang/rust
14+
* Implementation of `From<[T; N]>` for `BinaryHeap<T>`, ported from
15+
rust-lang/rust#84111
1616
* Links to referenced items in the documenation
1717
* Example of a min-heap, ported from rust-lang/rust#60451
1818
* Documentation of time complexities of several methods, ported from
1919
rust-lang/rust#60952
2020

2121
### Changed
2222

23-
* Bump MSRV (minimum supported rust version) to rust 1.52.0.
23+
* Migrate to Rust 2021 Edition
24+
* Increase MSRV (minimum supported rust version) to rust 1.56.0.
2425
* Implement `From<BinaryHeap<T, C>>` for `Vec<T>` instead of `Into<Vec<T>>` for
2526
`BinaryHeap<T, C>`
2627
* Port rust-lang/rust#77435 improvement to rebuild heuristic of

Cargo.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ repository = "https://github.com/sekineh/binary-heap-plus-rs"
88
readme = "README.md"
99
keywords = ["binary", "heap", "priority", "queue"]
1010
categories = ["data-structures", "algorithms", ]
11-
edition = "2018"
12-
13-
[build-dependencies]
14-
autocfg = "1"
11+
edition = "2021"
12+
rust-version = "1.56.0"
1513

1614
[dependencies]
1715
compare = "0.1.0"

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ This crate is based on the standard library's implementation of
2626
[`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html)
2727
from Rust 1.62.0.
2828

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.
29+
The minimum supported Rust version is 1.56.0.
3230

3331
# Changes
3432

build.rs

-8
This file was deleted.

src/binary_heap.rs

-11
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
//!
2222
//! ```
2323
//! use std::cmp::Ordering;
24-
//! // Only required for Rust versions prior to 1.43.0.
25-
//! use std::usize;
2624
//! use binary_heap_plus::BinaryHeap;
2725
//!
2826
//! #[derive(Copy, Clone, Eq, PartialEq)]
@@ -1258,12 +1256,7 @@ impl<T, C> BinaryHeap<T, C> {
12581256
/// heap.shrink_to(10);
12591257
/// assert!(heap.capacity() >= 10);
12601258
/// ```
1261-
///
1262-
/// # Compatibility
1263-
///
1264-
/// This feature requires Rust 1.56.0 or greater.
12651259
#[inline]
1266-
#[cfg(rustc_1_56)]
12671260
pub fn shrink_to(&mut self, min_capacity: usize) {
12681261
self.data.shrink_to(min_capacity)
12691262
}
@@ -1655,10 +1648,6 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
16551648
}
16561649
}
16571650

1658-
/// # Compatibility
1659-
///
1660-
/// This trait is only implemented for Rust 1.56.0 or greater.
1661-
#[cfg(rustc_1_56)]
16621651
impl<T: Ord, const N: usize> From<[T; N]> for BinaryHeap<T> {
16631652
/// ```
16641653
/// use binary_heap_plus::BinaryHeap;

0 commit comments

Comments
 (0)