summary refs log tree commit diff
path: root/library/std/src/collections/hash
AgeCommit message (Collapse)AuthorLines
2020-10-03Rollup merge of #75377 - canova:map_debug_impl, r=dtolnayJonas Schievink-8/+4
Fix Debug implementations of some of the HashMap and BTreeMap iterator types HashMap's `ValuesMut`, BTreeMaps `ValuesMut`, IntoValues and `IntoKeys` structs were printing both keys and values on their Debug implementations. But they are iterators over either keys or values. Irrelevant values should not be visible. With this PR, they only show relevant fields. This fixes #75297. [Here's an example code.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0c79356ed860e347a0c1a205616f93b7) This prints this on nightly: ``` ValuesMut { inner: IterMut { range: [(1, "hello"), (2, "goodbye")], length: 2 } } IntoKeys { inner: [(1, "hello"), (2, "goodbye")] } IntoValues { inner: [(1, "hello"), (2, "goodbye")] } [(2, "goodbye"), (1, "hello")] ``` After the patch this example prints these instead: ``` ["hello", "goodbye"] ["hello", "goodbye"] [1, 2] ["hello", "goodbye"] ``` I didn't add test cases for them, since I couldn't see any tests for Debug implementations anywhere. But please let me know if I should add it to a specific place. r? @dtolnay
2020-10-02Link `new` method in `DefautHasher`s docWaffle-4/+3
2020-09-27Rollup merge of #76917 - GuillaumeGomez:map-missing-code-examples, r=Dylan-DPCJonas Schievink-1/+106
Add missing code examples on HashMap types r? @Dylan-DPC
2020-09-21Add missing code examples on HashMap typesGuillaume Gomez-1/+106
2020-09-20Rollup merge of #76887 - GuillaumeGomez:hashset-iter-types-examples, r=Dylan-DPCRalf Jung-0/+86
Add missing examples on HashSet iter types
2020-09-18Add missing examples on HashSet iter typesGuillaume Gomez-0/+86
2020-09-18Fixed intra-docs links in library/std/src/collections/hash/map.rsAmjad Alsharafi-6/+0
2020-09-08Tests for HashMap/HashSet::drain_filterMatt Brubeck-0/+232
2020-09-08Add HashMap::drain_filter and HashSet::drain_filterMatt Brubeck-0/+171
Implements #59618.
2020-09-08Implement HashSet in terms of hashbrown::HashSetMatt Brubeck-58/+53
2020-09-08Update to hashbrown 0.9Matt Brubeck-5/+5
2020-09-06Auto merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAusbors-2/+2
Use Arc::clone and Rc::clone in documentation This PR replaces uses of `x.clone()` by `Rc::clone(&x)` (or `Arc::clone(&x)`) to better match the documentation for those types. @rustbot modify labels: T-doc
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-1350/+1346
Also doing fmt inplace as requested.
2020-08-30Move to Arc::clone(&x) over x.clone() in library/stdAlexis Bourget-2/+2
2020-08-11Remove the unused bounds from Debug impl of HashMap::{IntoKeys,IntoValues}Nazım Can Altınova-2/+2
2020-08-10Only print values in the Debug of HashMap::ValuesMut structNazım Can Altınova-6/+2
2020-08-08Update the tracking issue number of map_into_keys_valuesNazım Can Altınova-12/+12
2020-08-07Only print the fields that are relevant to iterators for Debug of IntoKeys ↵Nazım Can Altınova-2/+2
and IntoValues
2020-08-07Add unit tests for new `HashMap::into_{keys,values}` methodsNazım Can Altınova-0/+24
2020-08-07Add `into_{keys,values}` methods for HashMapNazım Can Altınova-0/+128
2020-08-07Update hashbrown to 0.8.1Amanieu d'Antras-4/+4
2020-07-27mv std libs to library/mark-0/+5538