Skip to content

Commit 32824b5

Browse files
authored
Rollup merge of #144758 - QnJ1c2kNCg:master, r=Noratrieb
[Doc] Add links to the various collections Add a few links to the collections mentioned in the module doc for Collections.
2 parents 8e62f0f + f4b3415 commit 32824b5

File tree

1 file changed

+6
-6
lines changed
  • library/std/src/collections

1 file changed

+6
-6
lines changed

library/std/src/collections/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//! should be considered. Detailed discussions of strengths and weaknesses of
2727
//! individual collections can be found on their own documentation pages.
2828
//!
29-
//! ### Use a `Vec` when:
29+
//! ### Use a [`Vec`] when:
3030
//! * You want to collect items up to be processed or sent elsewhere later, and
3131
//! don't care about any properties of the actual values being stored.
3232
//! * You want a sequence of elements in a particular order, and will only be
@@ -35,25 +35,25 @@
3535
//! * You want a resizable array.
3636
//! * You want a heap-allocated array.
3737
//!
38-
//! ### Use a `VecDeque` when:
38+
//! ### Use a [`VecDeque`] when:
3939
//! * You want a [`Vec`] that supports efficient insertion at both ends of the
4040
//! sequence.
4141
//! * You want a queue.
4242
//! * You want a double-ended queue (deque).
4343
//!
44-
//! ### Use a `LinkedList` when:
44+
//! ### Use a [`LinkedList`] when:
4545
//! * You want a [`Vec`] or [`VecDeque`] of unknown size, and can't tolerate
4646
//! amortization.
4747
//! * You want to efficiently split and append lists.
4848
//! * You are *absolutely* certain you *really*, *truly*, want a doubly linked
4949
//! list.
5050
//!
51-
//! ### Use a `HashMap` when:
51+
//! ### Use a [`HashMap`] when:
5252
//! * You want to associate arbitrary keys with an arbitrary value.
5353
//! * You want a cache.
5454
//! * You want a map, with no extra functionality.
5555
//!
56-
//! ### Use a `BTreeMap` when:
56+
//! ### Use a [`BTreeMap`] when:
5757
//! * You want a map sorted by its keys.
5858
//! * You want to be able to get a range of entries on-demand.
5959
//! * You're interested in what the smallest or largest key-value pair is.
@@ -65,7 +65,7 @@
6565
//! * There is no meaningful value to associate with your keys.
6666
//! * You just want a set.
6767
//!
68-
//! ### Use a `BinaryHeap` when:
68+
//! ### Use a [`BinaryHeap`] when:
6969
//!
7070
//! * You want to store a bunch of elements, but only ever want to process the
7171
//! "biggest" or "most important" one at any given time.

0 commit comments

Comments
 (0)