Skip to content

Commit ca13fd2

Browse files
committed
Rollup merge of rust-lang#22973 - djmally:coll_docs, r=Gankro
2 parents 145b83e + 0a17764 commit ca13fd2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/libstd/collections/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! * You want a bit vector.
7979
//!
8080
//! ### Use a `BitSet` when:
81-
//! * You want a `VecSet`.
81+
//! * You want a `BitVec`, but want `Set` properties
8282
//!
8383
//! ### Use a `BinaryHeap` when:
8484
//! * You want to store a bunch of elements, but only ever want to process the "biggest"
@@ -89,7 +89,8 @@
8989
//!
9090
//! Choosing the right collection for the job requires an understanding of what each collection
9191
//! is good at. Here we briefly summarize the performance of different collections for certain
92-
//! important operations. For further details, see each type's documentation.
92+
//! important operations. For further details, see each type's documentation, and note that the
93+
//! names of actual methods may differ from the tables below on certain collections.
9394
//!
9495
//! Throughout the documentation, we will follow a few conventions. For all operations,
9596
//! the collection's size is denoted by n. If another collection is involved in the operation, it
@@ -280,16 +281,16 @@
280281
//! a variant of the `Entry` enum.
281282
//!
282283
//! If a `Vacant(entry)` is yielded, then the key *was not* found. In this case the
283-
//! only valid operation is to `set` the value of the entry. When this is done,
284+
//! only valid operation is to `insert` a value into the entry. When this is done,
284285
//! the vacant entry is consumed and converted into a mutable reference to the
285286
//! the value that was inserted. This allows for further manipulation of the value
286287
//! beyond the lifetime of the search itself. This is useful if complex logic needs to
287288
//! be performed on the value regardless of whether the value was just inserted.
288289
//!
289290
//! If an `Occupied(entry)` is yielded, then the key *was* found. In this case, the user
290-
//! has several options: they can `get`, `set`, or `take` the value of the occupied
291+
//! has several options: they can `get`, `insert`, or `remove` the value of the occupied
291292
//! entry. Additionally, they can convert the occupied entry into a mutable reference
292-
//! to its value, providing symmetry to the vacant `set` case.
293+
//! to its value, providing symmetry to the vacant `insert` case.
293294
//!
294295
//! ### Examples
295296
//!
@@ -329,7 +330,7 @@
329330
//! use std::collections::btree_map::{BTreeMap, Entry};
330331
//!
331332
//! // A client of the bar. They have an id and a blood alcohol level.
332-
//! struct Person { id: u32, blood_alcohol: f32 };
333+
//! struct Person { id: u32, blood_alcohol: f32 }
333334
//!
334335
//! // All the orders made to the bar, by client id.
335336
//! let orders = vec![1,2,1,2,3,4,1,2,2,3,4,1,1,1];

0 commit comments

Comments
 (0)