diff options
| author | bors <bors@rust-lang.org> | 2021-12-10 21:59:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-10 21:59:07 +0000 |
| commit | f0448f44bcda55fd9eb71da82495ef648eedb4e4 (patch) | |
| tree | d7157697f5cdcd6bf59adb15521427a212f0dbce /library/alloc/src | |
| parent | 0b42deaccc2cbe17a68067aa5fdb76104369e1fd (diff) | |
| parent | 1fca934898354160b46c17c58b67707a2dcb8988 (diff) | |
| download | rust-f0448f44bcda55fd9eb71da82495ef648eedb4e4.tar.gz rust-f0448f44bcda55fd9eb71da82495ef648eedb4e4.zip | |
Auto merge of #91760 - matthiaskrgr:rollup-zcemh6j, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #90407 (Document all public items in `rustc_incremental`) - #90897 (Fix incorrect stability attributes) - #91105 (Fix method name reference in stream documentation) - #91325 (adjust const_eval_select documentation) - #91470 (code-cov: generate dead functions with private/default linkage) - #91482 (Update documentation to use `from()` to initialize `HashMap`s and `BTreeMap`s) - #91524 (Fix Vec::extend_from_slice docs) - #91575 (Fix ICE on format string of macro with secondary-label) - #91625 (Remove redundant [..]s) - #91646 (Fix documentation for `core::ready::Ready`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 9 | ||||
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 3bd5b8ddf08..199c05dc5df 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -2107,10 +2107,11 @@ impl<K, V> BTreeMap<K, V> { /// ``` /// use std::collections::BTreeMap; /// - /// let mut map = BTreeMap::new(); - /// map.insert("a", 1); - /// map.insert("b", 2); - /// map.insert("c", 3); + /// let mut map = BTreeMap::from([ + /// ("a", 1), + /// ("b", 2), + /// ("c", 3), + /// ]); /// /// // add 10 to the value if the key isn't "a" /// for (key, value) in map.iter_mut() { diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index f1b70fa2802..408c3cb8577 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2199,7 +2199,7 @@ impl<T: Clone, A: Allocator> Vec<T, A> { /// Clones and appends all elements in a slice to the `Vec`. /// /// Iterates over the slice `other`, clones each element, and then appends - /// it to this `Vec`. The `other` vector is traversed in-order. + /// it to this `Vec`. The `other` slice is traversed in-order. /// /// Note that this function is same as [`extend`] except that it is /// specialized to work with slices instead. If and when Rust gets |
