# Append Vec to BinaryHeap?

**URL:** <https://internals.rust-lang.org/t/append-vec-to-binaryheap/15209>\
**Category:** Uncategorized\
**Created:** [August 22, 2021, 6:30pm UTC](https://internals.rust-lang.org/t/append-vec-to-binaryheap/15209 "2021-08-22T18:30:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![SkiFire13](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/skifire13/32/7579_2.png) [@SkiFire13](https://internals.rust-lang.org/u/SkiFire13)\
**Post date:** [August 22, 2021, 8:16pm UTC](https://internals.rust-lang.org/t/append-vec-to-binaryheap/15209/3 "2021-08-22T20:16:56Z")

</div>

However looks like extending a `BinaryHeap` with a `Drain` falls back to just `push`ing each element, which may be much slower than rebuilding the heap if the `Drain` contained a lot of elements.

---

_[View the full topic](https://internals.rust-lang.org/t/append-vec-to-binaryheap/15209)._
