diff options
| author | Michael Howell <michael@notriddle.com> | 2020-09-09 11:53:24 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2020-09-09 11:53:24 -0700 |
| commit | 8b0d0a0cadbaaf0e7f4114e289a71981872c8587 (patch) | |
| tree | 38e469e6c31c90e0782289902294b8e47fb76a75 | |
| parent | d85db82960db80132a10d25e0fe7dfd5f4736d0f (diff) | |
| download | rust-8b0d0a0cadbaaf0e7f4114e289a71981872c8587.tar.gz rust-8b0d0a0cadbaaf0e7f4114e289a71981872c8587.zip | |
Add documentation for `impl<T> From<BinaryHeap<T>> for Vec<T>`
| -rw-r--r-- | library/alloc/src/collections/binary_heap.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index 40aa4d850f5..24d17fdd880 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -1343,6 +1343,10 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> { #[stable(feature = "binary_heap_extras_15", since = "1.5.0")] impl<T> From<BinaryHeap<T>> for Vec<T> { + /// Converts a `BinaryHeap<T>` into a `Vec<T>`. + /// + /// This conversion requires no data movement or allocation, and has + /// constant time complexity. fn from(heap: BinaryHeap<T>) -> Vec<T> { heap.data } |
