Skip to content

Commit 8a1cdc5

Browse files
authored
Rollup merge of #82434 - jyn514:hash, r=JohnTitor
Add more links between hash and btree collections - Link from `core::hash` to `HashMap` and `HashSet` - Link from HashMap and HashSet to the module-level documentation on when to use the collection - Link from several collections to Wikipedia articles on the general concept See also rust-lang/rust#81989 (comment).
2 parents 395ccd0 + 924283f commit 8a1cdc5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

collections/btree/map.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ use Entry::*;
2121
/// We might temporarily have fewer elements during methods.
2222
pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
2323

24-
// A tree in a `BTreeMap` is a tree in the `node` module with addtional invariants:
24+
// A tree in a `BTreeMap` is a tree in the `node` module with additional invariants:
2525
// - Keys must appear in ascending order (according to the key's type).
2626
// - If the root node is internal, it must contain at least 1 element.
2727
// - Every non-root node contains at least MIN_LEN elements.
2828
//
29-
// An empty map may be represented both by the absense of a root node or by a
29+
// An empty map may be represented both by the absence of a root node or by a
3030
// root node that is an empty leaf.
3131

32-
/// A map based on a B-Tree.
32+
/// A map based on a [B-Tree].
3333
///
3434
/// B-Trees represent a fundamental compromise between cache-efficiency and actually minimizing
3535
/// the amount of work performed in a search. In theory, a binary search tree (BST) is the optimal
@@ -63,6 +63,7 @@ pub(super) const MIN_LEN: usize = node::MIN_LEN_AFTER_SPLIT;
6363
/// undefined behavior. This could include panics, incorrect results, aborts, memory leaks, and
6464
/// non-termination.
6565
///
66+
/// [B-Tree]: https://en.wikipedia.org/wiki/B-tree
6667
/// [`Cell`]: core::cell::Cell
6768
/// [`RefCell`]: core::cell::RefCell
6869
///

0 commit comments

Comments
 (0)