rust/src/liballoc
bors aa4e57ca8f 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 )
2019-10-31 15:15:53 +00:00
..
alloc liballoc: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
benches bump rand to fix Miri failures 2019-08-04 14:50:26 +02:00
collections fix doctest 2019-10-25 19:55:58 +09:00
prelude Replace SliceConcatExt trait with inherent methods and SliceConcat helper trait 2019-07-05 11:49:30 +02:00
raw_vec A few cosmetic improvements to code & comments in liballoc and libcore 2019-09-06 16:02:25 +01:00
rc Add implementations for converting boxed slices into boxed arrays 2019-08-05 10:26:53 -04:00
sync Add implementations for converting boxed slices into boxed arrays 2019-08-05 10:26:53 -04:00
tests Auto merge of #65091 - sekineh:into-iter-sorted, r=KodrAus 2019-10-31 15:15:53 +00:00
alloc.rs Snap cfgs to new beta 2019-09-25 08:42:46 -04:00
borrow.rs Add Cow::is_borrowed and Cow::is_owned 2019-10-22 19:56:41 -04:00
boxed.rs Uninitialized boxes: check for zero-size allocation based on Layout::size 2019-10-16 20:32:58 +02:00
Cargo.toml bump rand to fix Miri failures 2019-08-04 14:50:26 +02:00
fmt.rs example for padding any format 2019-10-17 23:02:09 +02:00
lib.rs Add Cow::is_borrowed and Cow::is_owned 2019-10-22 19:56:41 -04:00
macros.rs Improve hygiene of alloc::format! 2019-09-07 22:40:57 +03:00
raw_vec.rs Const-stabilize Vec::new. 2019-09-16 16:45:16 +02:00
rc.rs some more Rc tweaks 2019-10-19 13:47:32 +02:00
slice.rs Stabilize slice::repeat (feature repeat_generic_slice) 2019-10-02 04:48:15 +00:00
str.rs Apply clippy::needless_return suggestions 2019-10-22 19:23:10 +02:00
string.rs Add {String,Vec}::into_raw_parts 2019-10-25 11:25:52 -04:00
sync.rs Apply clippy::needless_return suggestions 2019-10-22 19:23:10 +02:00
tests.rs Add implementations for converting boxed slices into boxed arrays 2019-08-05 10:26:53 -04:00
vec.rs Rollup merge of #65887 - lzutao:doc-vec-get, r=rkruppe 2019-10-28 21:36:06 +01:00