about summary refs log tree commit diff
path: root/library/std/src/collections
AgeCommit message (Collapse)AuthorLines
2025-08-26remove deprecated Error::description in implsMarijn Schouten-6/+1
2025-08-21Rollup merge of #144758 - QnJ1c2kNCg:master, r=NoratriebJacob Pratt-6/+6
[Doc] Add links to the various collections Add a few links to the collections mentioned in the module doc for Collections.
2025-08-09`HashMap`: also add "Usage with custom key types" headingAda Alakbarova-0/+2
2025-08-09`{BTree,Hash}Map`: add "`Entry` API" section headingAda Alakbarova-0/+2
2025-07-31[Doc] Add links to the various collectionsBruno Roy-6/+6
Add a few links to the collections mentioned in the module doc for Collections.
2025-05-17Docs(lib/coll/hm): Add kv pair to `extract_if`'s first sentencePaul Mabileau-1/+1
Make it consistent in this regard with `BTreeMap`'s. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-17Docs(lib/extract_if): Unify paragraph about elements mutationPaul Mabileau-2/+2
Take the one from `BTreeMap` that seems the best-worded and most precise among the available variations. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-17Docs(lib/extract_if): Unify paragraph about closure actionsPaul Mabileau-6/+6
Also fixes `HashSet`'s that incorrectly designated itself as a `list`. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-17Docs(lib/coll/hm): Reword `extract_if` to use `element` instead of `value`Paul Mabileau-3/+3
A minor change, but it seemed interesting to unify this one's description, especially considering all the other equivalents use `element` as well. Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
2025-05-12update version placeholdersPietro Albini-10/+10
2025-05-05Consistent trait bounds for ExtractIf Debug implsDavid Tolnay-22/+17
2025-04-24Rollup merge of #139307 - xizheyin:issue-139296, r=joboetMatthias Krüger-0/+3
std: Add performance warnings to HashMap::get_disjoint_mut Closes #139296 The `get_disjoint_mut` in `HashMap` also performs a complexity O(n^2) check. So we need to be reminded of that as well. https://github.com/rust-lang/hashbrown/blob/b5b0655a37e156f9798ac8dd7e970d4adba9bf90/src/raw/mod.rs#L1216-L1220
2025-04-20Use `currently` for futher improvementxizheyin-1/+1
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
2025-04-09replace version placeholderBoxy-10/+10
2025-04-05std: Add performance warnings to HashMap::get_disjoint_mutxizheyin-0/+3
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-14Rollup merge of #137870 - karolzwolak:lazylock-const-hashmaps-137566, r=cuviperJacob Pratt-7/+19
Improve HashMap docs for const and static initializers Closes #137566. I clarified the HashMap usage in const and static initializers. I also added examples of how to construct such HashMaps wrapped in LazyLock.
2025-03-12Remove `feature = "hash_raw_entry"`Josh Stone-564/+0
2025-03-01docs(std): mention LazyLock in const/static HashMap constructionKarol Zwolak-7/+19
2025-02-24Rollup merge of #134655 - GrigorenkoPV:hash_extract_if, r=cuviperTrevor Gross-16/+10
Stabilize `hash_extract_if` FCP complete: https://github.com/rust-lang/rust/issues/59618#issuecomment-2674880530 Tracking issue: #59618 Closes #59618
2025-02-18update version placeholdersJosh Stone-2/+2
(cherry picked from commit e4840ce59bdddb19394df008c5c26d9c493725f8)
2025-02-07Clean up 'HashMap' and 'HashSet' docs;Gabriel Bjørnager Jensen-8/+8
2025-01-27Stabilize `HashMap::get_many_mut` as `HashMap::get_disjoint_mut`Urgau-15/+17
as well as `HashMap::get_many_unchecked_mut` to `HashMap::get_disjoint_unchecked_mut`.
2025-01-08fmtPietro Albini-8/+2
2025-01-08update version placeholdersPietro Albini-2/+2
2024-12-22Specify only that duplicates are discarded, not the order.Kevin Reid-4/+5
2024-12-22Stabilize `hash_extract_if`Pavel Grigorenko-16/+10
2024-12-21Document collection `From` and `FromIterator` impls that drop duplicate keys.Kevin Reid-0/+13
This behavior is worth documenting because there are other plausible alternatives, such as panicking when a duplicate is encountered, and it reminds the programmer to consider whether they should, for example, coalesce duplicate keys first.
2024-12-03./x miri: fix sysroot buildRalf Jung-4/+4
2024-12-02stabilize const_collections_with_hasher and build_hasher_default_const_newRalf Jung-2/+46
2024-11-28Also use zero when referencing to capacity or lengthtimvisee-4/+4
2024-11-18Improve `{BTreeMap,HashMap}::get_key_value` docs.Nicholas Nethercote-4/+36
They are unusual methods. The docs don't really describe the cases when they might be useful (as opposed to just `get`), and the examples don't demonstrate the interesting cases at all. This commit improves the docs and the examples.
2024-11-11Rollup merge of #120077 - SUPERCILEX:set-entry, r=AmanieuMatthias Krüger-0/+449
Add Set entry API See https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/HashSet.3A.3Aentry/near/413224639 and https://github.com/rust-lang/rust/issues/60896#issuecomment-678708111 Closes https://github.com/rust-lang/rfcs/issues/1490
2024-11-02Add Set entry APIAlex Saveau-0/+449
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2024-11-02const_with_hasher test: actually construct a usable HashMapRalf Jung-3/+23
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-1/+1
2024-10-15replace placeholder versionJosh Stone-12/+12
(cherry picked from commit 567fd9610cbfd220844443487059335d7e1ff021)
2024-10-02impl Default for Hash{Map,Set} iterators that don't already have itltdk-0/+80
2024-10-02Update hashbrown to 0.15 and adjust some methodsUrgau-114/+55
as well as removing some from std as they no longer exists in Hashbrown it-self.
2024-10-01make test_lots_of_insertions test take less long in MiriRalf Jung-1/+1
2024-09-29Fix std tests for wasm32-wasip2 targetNicola Krumschmidt-0/+5
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-7/+7
2024-09-19[Clippy] Swap `iter_over_hash_type` to use diagnostic items instead of pathsGnomedDev-0/+8
2024-09-19[Clippy] Swap `map_entry` to use diagnostic items instead of pathsGnomedDev-0/+2
2024-09-18[Clippy] Swap `manual_retain` to use diagnostic items instead of pathsGnomedDev-0/+1
2024-09-13Stabilize entry_insertFélix Saparelli-4/+2
2024-09-10Clarify docs for std::collectionsJames Liu-27/+35
Page affected: https://doc.rust-lang.org/std/collections/index.html#performance Changes: - bulleted conventions - expanded definitions on terms used - more accessible language - merged Sequence and Map performance cost tables
2024-07-29Reformat `use` declarations.Nicholas Nethercote-26/+19
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-14std: Unsafe-wrap HashMap::get_many_unchecked_mutJubilee Young-3/+1
2024-07-14std: deny(unsafe_op_in_unsafe_fn) but allow sitesJubilee Young-0/+2
This provides a list of locations to hunt down issues in.
2024-06-03Fix typo in the docs of `HashMap::raw_entry_mut`Tim Kurdov-1/+1