about summary refs log tree commit diff
path: root/src/liballoc/btree/map.rs
AgeCommit message (Collapse)AuthorLines
2018-06-29Move some alloc crate top-level items to a new alloc::collections moduleSimon Sapin-2578/+0
This matches std::collections
2018-06-10Stabilize entry-or-defaultGuillaume Gomez-2/+1
2018-06-02Copy changes from HashMap over to BTreeMap.Corey Farwell-2/+15
2018-05-24stabilize RangeBounds collections_range #30877Cory Sherman-3/+3
rename RangeBounds::start() -> start_bound() rename RangeBounds::end() -> end_bound()
2018-05-08Make an ensure_root_is_owned method to reduce duplicationC Jones-11/+10
Also remove some unnecessary debug_assert! when creating the shared root, since the root should be stored in the rodata and thus be impossible to accidentally modify.
2018-05-07Add debug asserts and fix some violationsC Jones-0/+5
2018-05-07Don't drop the shared static nodeC Jones-4/+4
We modify the drop implementation in IntoIter to not drop the shared root
2018-05-07Add a statically allocated empty node for empty mapsC Jones-2/+13
This gives a pointer to that static empty node instead of allocating a new node, and then whenever inserting makes sure that the root isn't that empty node.
2018-04-19Tweak some stabilizations in libstdAlex Crichton-2/+2
This commit tweaks a few stable APIs in the `beta` branch before they hit stable. The `str::is_whitespace` and `str::is_alphanumeric` functions were deleted (added in #49381, issue at #49657). The `and_modify` APIs added in #44734 were altered to take a `FnOnce` closure rather than a `FnMut` closure. Closes #49581 Closes #49657
2018-04-16Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundibors-2/+1
Replace manual iterator exhaust with for_each(drop) This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic. <del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion. <del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to: <del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del> <del>Is not as clear as: <del>`self.exhaust(); unsafe { free(self.ptr); }` <del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.
2018-04-04Replace manual iter exhaust with for_each(drop).Clar Charr-2/+1
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-4/+4
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-2/+2
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-25Implement get_key_value for HashMap, BTreeMapDiggory Blake-0/+27
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-8/+8
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-8/+8
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-02-251.25.0 -> 1.26.-Manish Goregaokar-1/+1
2018-02-12Stabilize 'entry_and_modify' feature for BTreeMaphedgehog1024-2/+1
2018-01-28Document that `Index` ops can panic on `HashMap` & `BTreeMap`.Corey Farwell-0/+5
Fixes https://github.com/rust-lang/rust/issues/47011.
2017-10-06Implement `entry_and_modify`mchlrhw-0/+34
2017-09-05Avoid weird or_insert_with exampleJon Gjengset-3/+1
2017-09-05Add or_default to Entry APIsJon Gjengset-0/+29
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-7/+7
Like #43008 (f668999), but _much more aggressive_.
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-2/+3
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-24Stabilize RangeArgumentSteven Fackler-3/+2
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-23Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.Federico Ravasio-2/+2
Fixed #41924.
2017-06-23Correctly iterate on keys/values when debugging BTreeMap::{Keys,Values}.Federico Ravasio-2/+2
2017-06-13Merge crate `collections` into `alloc`Murarth-0/+2460