about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-31 15:15:53 +0000
committerbors <bors@rust-lang.org>2019-10-31 15:15:53 +0000
commitaa4e57ca8f18b836bf77923cd0d9ad1390f0110b (patch)
treeed4e7119840dea12d6ec237a7e018edfc5d8c63b /src/liballoc/string.rs
parent92df638162b7ccea6f97a8e1287ed05c5c0818b4 (diff)
parent95442ae251d24c062ca317dcafdf3240f3cec846 (diff)
downloadrust-aa4e57ca8f18b836bf77923cd0d9ad1390f0110b.tar.gz
rust-aa4e57ca8f18b836bf77923cd0d9ad1390f0110b.zip
Auto merge of #65091 - sekineh:into-iter-sorted, r=KodrAus
Implement ordered/sorted iterators on BinaryHeap as per #59278

I've implemented the ordered version of iterator on BinaryHeap as per #59278.

# Added methods:

* `.into_iter_sorted()`
  * like `.into_iter()`; but returns elements in heap order
* `.drain_sorted()`
  * like `.drain()`; but returns elements in heap order
  * It's a bit _lazy_; elements are removed on drop. (Edit: it’s similar to vec::Drain)

For `DrainSorted` struct, I implemented `Drop` trait following @scottmcm 's [suggestion](https://github.com/rust-lang/rust/issues/59278#issuecomment-537306925)

# ~TODO~ DONE
* ~I think I need to add more tests other than doctest.~

# **Notes:**
* we renamed `_ordered` to `_sorted`, because the latter is more common in rust libs. (as suggested by @KodrAus )
Diffstat (limited to 'src/liballoc/string.rs')
0 files changed, 0 insertions, 0 deletions