about summary refs log tree commit diff
path: root/library/alloc/src/collections/btree/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-01-20alloc: add `#![warn(unreachable_pub)]`Urgau-2/+2
2024-11-13btree: simplify the backdoor between set and mapJosh Stone-8/+0
The internal `btree::Recover` trait acted as a private API between `BTreeSet` and `BTreeMap`, but we can use `pub(_)` restrictions these days, and some of the methods don't need special handling anymore. * `BTreeSet::get` can use `BTreeMap::get_key_value` * `BTreeSet::take` can use `BTreeMap::remove_entry` * `BTreeSet::replace` does need help, but this now uses a `pub(super)` method on `BTreeMap` instead of the trait. * `btree::Recover` is now removed.
2023-03-20Remove outdated commentsMaybe Waffle-1/+0
2022-12-28Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514fee1-dead-3/+0
Test leaking of BinaryHeap Drain iterators Add test cases about forgetting the `BinaryHeap::Drain` iterator, and slightly fortifies some other test cases. Consists of separate commits that I don't think are relevant on their own (but I'll happily turn these into more PRs if desired).
2022-06-23Fix BTreeSet's range API panic message, documenttnballo-0/+1
2022-05-02Share testing utilities with non-btree test casesStein Somers-3/+0
2021-08-28BTreeMap::from_iter: use bulk building to improve the performanceCheng XU-0/+1
Bulk building is a common technique to increase the performance of building a fresh btree map. Instead of inserting items one-by-one, we sort all the items beforehand then create the BtreeMap in bulk.
2021-02-22Auto merge of #81362 - ssomers:btree_drainy_refactor_8, r=Mark-Simulacrumbors-0/+1
BTreeMap: gather and decompose reusable tree fixing functions This is kind of pushing it as a standalone refactor, probably only useful for #81075 (or similar). r? `@Mark-Simulacrum`
2021-02-09BTreeMap: gather and decompose reusable tree fixing functionsStein Somers-0/+1
2021-02-09BTreeMap/BTreeSet: separate off code supporting testsStein Somers-29/+1
2021-01-29btree: use Option's unwrap_unchecked()Miguel Ojeda-16/+0
Now that https://github.com/rust-lang/rust/issues/81383 is available, start using it. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2020-12-24BTreeMap: test split_off (and append) more thoroughlyStein Somers-2/+5
2020-11-08BTreeMap: split off most code of append, slightly improve interfacesStein Somers-0/+1
2020-10-29BTreeMap: document a curious assumption in test casesStein Somers-0/+1
2020-10-26BTreeMap: move generic functions out of navigate.rsStein Somers-0/+1
2020-10-22BTreeMap/Set: merge the implementations of MergeIterStein Somers-0/+1
2020-10-18BTreeMap: split off most code of remove and split_offStein Somers-0/+2
2020-09-10Auto merge of #74437 - ssomers:btree_no_root_in_noderef, r=Mark-Simulacrumbors-0/+1
BTreeMap: move up reference to map's root from NodeRef Since the introduction of `NodeRef` years ago, it also contained a mutable reference to the owner of the root node of the tree (somewhat disguised as *const). Its intent is to be used only when the rest of the `NodeRef` is no longer needed. Moving this to where it's actually used, thought me 2 things: - Some sort of "postponed mutable reference" is required in most places that it is/was used, and that's exactly where we also need to store a reference to the length (number of elements) of the tree, for the same reason. The length reference can be a normal reference, because the tree code does not care about tree length (just length per node). - It's downright obfuscation in `from_sorted_iter` (transplanted to #75329) - It's one of the reasons for the scary notice on `reborrow_mut`, the other one being addressed in #73971. This does repeat the raw pointer code in a few places, but it could be bundled up with the length reference. r? `@Mark-Simulacrum`
2020-09-10Document btree's unwrap_uncheckedStein Somers-0/+3
2020-09-10BTreeMap: pull the map's root out of NodeRefStein Somers-0/+1
2020-08-14Move btree unit test to their native, privileged locationStein Somers-0/+27
2020-07-27mv std libs to library/mark-0/+27