about summary refs log tree commit diff
path: root/src/liballoc/collections
diff options
context:
space:
mode:
authorObserver42 <yishengxu@outlook.com>2019-08-12 16:07:13 +0800
committerObserver42 <yishengxu@outlook.com>2019-08-12 16:07:13 +0800
commitfa7a40cc6ee7e16c948a804dbb487d36b3d0ccc9 (patch)
treeb58f54fe7ec78ff280a8bd0fdf260d350d32c1fb /src/liballoc/collections
parent2b78e10ac1454d2d4190c575f6ece03f484ac398 (diff)
downloadrust-fa7a40cc6ee7e16c948a804dbb487d36b3d0ccc9.tar.gz
rust-fa7a40cc6ee7e16c948a804dbb487d36b3d0ccc9.zip
Document From trait for BinaryHeap
Diffstat (limited to 'src/liballoc/collections')
-rw-r--r--src/liballoc/collections/binary_heap.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/liballoc/collections/binary_heap.rs b/src/liballoc/collections/binary_heap.rs
index 9f531f5b83c..cc6c69d5738 100644
--- a/src/liballoc/collections/binary_heap.rs
+++ b/src/liballoc/collections/binary_heap.rs
@@ -1163,6 +1163,9 @@ impl<T> FusedIterator for Drain<'_, T> {}
 
 #[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
 impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
+    /// Converts a `Vec` into a `BinaryHeap`.
+    ///
+    /// This conversion happens in-place, and has O(n) time complexity.
     fn from(vec: Vec<T>) -> BinaryHeap<T> {
         let mut heap = BinaryHeap { data: vec };
         heap.rebuild();