Skip to content

Commit ae09fe7

Browse files
committed
Port updated example from rust-lang/rust
This commits ports one small part of rust-lang/rust#91861. The main change that PR made to `binary_heap.rs` was to replace vectors with arrays in the examples. We do *not* port such changes as they require Rust 1.56.0, which is greater than this crate's current MSRV. However, it also simplified the setup in the example of `BinaryHeap::append()`, and we repeat that here only with vectors instead of arrays.
1 parent 5837ac2 commit ae09fe7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/binary_heap.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1064,11 +1064,8 @@ impl<T, C: Compare<T>> BinaryHeap<T, C> {
10641064
/// ```
10651065
/// use binary_heap_plus::BinaryHeap;
10661066
///
1067-
/// let v = vec![-10, 1, 2, 3, 3];
1068-
/// let mut a = BinaryHeap::from(v);
1069-
///
1070-
/// let v = vec![-20, 5, 43];
1071-
/// let mut b = BinaryHeap::from(v);
1067+
/// let mut a = BinaryHeap::from(vec![-10, 1, 2, 3, 3]);
1068+
/// let mut b = BinaryHeap::from(vec![-20, 5, 43]);
10721069
///
10731070
/// a.append(&mut b);
10741071
///

0 commit comments

Comments
 (0)