You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+5-15Lines changed: 5 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,10 @@
7
7
//! # Quick start
8
8
//!
9
9
//! ## Max/Min Heap
10
-
//!
10
+
//!
11
11
//! For max heap, `BiaryHeap::from_vec()` is the most versatile way to create a heap.
12
12
//!
13
13
//! ```rust
14
-
//! extern crate binary_heap_plus; // not needed on Rust 2018
15
14
//! use binary_heap_plus::*;
16
15
//!
17
16
//! // max heap
@@ -22,11 +21,10 @@
22
21
//! let mut h: BinaryHeap<i32> = BinaryHeap::from_vec((0..42).collect());
23
22
//! assert_eq!(h.pop(), Some(41));
24
23
//! ```
25
-
//!
24
+
//!
26
25
//! Min heap is similar, but requires type annotation.
27
-
//!
26
+
//!
28
27
//! ```rust
29
-
//! extern crate binary_heap_plus; // not needed on Rust 2018
30
28
//! use binary_heap_plus::*;
31
29
//!
32
30
//! // min heap
@@ -39,11 +37,10 @@
39
37
//! ```
40
38
//!
41
39
//! ## Custom Heap
42
-
//!
40
+
//!
43
41
//! 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
+
//!
45
43
//! ```rust
46
-
//! extern crate binary_heap_plus; // not needed on Rust 2018
47
44
//! use binary_heap_plus::*;
48
45
//!
49
46
//! // custom heap: ordered by second value (_.1) of the tuples; min first
@@ -98,12 +95,6 @@
98
95
99
96
mod binary_heap;
100
97
pubusecrate::binary_heap::*;
101
-
externcrate compare;
102
-
externcrate core;
103
-
#[cfg(feature = "serde")]
104
-
externcrate serde;
105
-
#[cfg(all(feature = "serde", test))]
106
-
externcrate serde_json;
107
98
108
99
/// An intermediate trait for specialization of `Extend`.
0 commit comments