Skip to content

Commit 2c4e2ca

Browse files
authored
Merge pull request sekineh#19 from sekineh/rust-2018
Migrate to Rust 2018 Edition, etc.
2 parents 1453d8c + 79b63b8 commit 2c4e2ca

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Changed
1414

15+
* Migrate to Rust 2018 Edition.
1516
* Bump MSRV (minimum supported rust version) to rust 1.31.1.
1617
* [CI] Switched to Github actions.
1718
* [CI] travis is removed because it was unreliable.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ 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"
1112

1213
[dependencies]
1314
compare = "0.1.0"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# binary-heap-plus-rs
22

33
![Rust](https://github.com/sekineh/binary-heap-plus-rs/workflows/Rust/badge.svg)
4-
[![Build status](https://ci.appveyor.com/api/projects/status/oewb6667ul5pl05d?svg=true)](https://ci.appveyor.com/project/sekineh/binary-heap-plus-rs)
54

65
Enhancement over Rust's `std::collections::BinaryHeap`.
76

src/lib.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
//! # Quick start
88
//!
99
//! ## Max/Min Heap
10-
//!
10+
//!
1111
//! For max heap, `BiaryHeap::from_vec()` is the most versatile way to create a heap.
1212
//!
1313
//! ```rust
14-
//! extern crate binary_heap_plus; // not needed on Rust 2018
1514
//! use binary_heap_plus::*;
1615
//!
1716
//! // max heap
@@ -22,11 +21,10 @@
2221
//! let mut h: BinaryHeap<i32> = BinaryHeap::from_vec((0..42).collect());
2322
//! assert_eq!(h.pop(), Some(41));
2423
//! ```
25-
//!
24+
//!
2625
//! Min heap is similar, but requires type annotation.
27-
//!
26+
//!
2827
//! ```rust
29-
//! extern crate binary_heap_plus; // not needed on Rust 2018
3028
//! use binary_heap_plus::*;
3129
//!
3230
//! // min heap
@@ -39,11 +37,10 @@
3937
//! ```
4038
//!
4139
//! ## Custom Heap
42-
//!
40+
//!
4341
//! For custom heap, `BinaryHeap::from_vec_cmp()` works in a similar way to max/min heap. The only difference is that you add the comparator closure with apropriate signature.
44-
//!
42+
//!
4543
//! ```rust
46-
//! extern crate binary_heap_plus; // not needed on Rust 2018
4744
//! use binary_heap_plus::*;
4845
//!
4946
//! // custom heap: ordered by second value (_.1) of the tuples; min first
@@ -98,12 +95,6 @@
9895
9996
mod binary_heap;
10097
pub use crate::binary_heap::*;
101-
extern crate compare;
102-
extern crate core;
103-
#[cfg(feature = "serde")]
104-
extern crate serde;
105-
#[cfg(all(feature = "serde", test))]
106-
extern crate serde_json;
10798

10899
/// An intermediate trait for specialization of `Extend`.
109100
// #[doc(hidden)]
@@ -413,7 +404,6 @@ mod from_liballoc {
413404
d
414405
}
415406
}
416-
417407
}
418408

419409
#[cfg(feature = "serde")]

0 commit comments

Comments
 (0)