diff options
| author | bstrie <865233+bstrie@users.noreply.github.com> | 2021-04-11 18:38:44 -0400 |
|---|---|---|
| committer | bstrie <865233+bstrie@users.noreply.github.com> | 2021-06-30 17:28:17 -0400 |
| commit | 2db05230d35c068c557fe476cf16197836580c2d (patch) | |
| tree | b607e9b105ebad19c901722e8a59a8130068015a /library/alloc/src/vec | |
| parent | 7953910464e073eb3876d1544a3fd5b5ba0ca49b (diff) | |
| download | rust-2db05230d35c068c557fe476cf16197836580c2d.tar.gz rust-2db05230d35c068c557fe476cf16197836580c2d.zip | |
impl From<[(K, V); N]> for std::collections
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 91c3b16deee..617c76a680b 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -152,12 +152,13 @@ mod spec_extend; /// assert_eq!(vec, [7, 1, 2, 3]); /// ``` /// -/// The [`vec!`] macro is provided to make initialization more convenient: +/// The [`vec!`] macro is provided for convenient initialization: /// /// ``` -/// let mut vec = vec![1, 2, 3]; -/// vec.push(4); -/// assert_eq!(vec, [1, 2, 3, 4]); +/// let mut vec1 = vec![1, 2, 3]; +/// vec1.push(4); +/// let vec2 = Vec::from([1, 2, 3, 4]); +/// assert_eq!(vec1, vec2); /// ``` /// /// It can also initialize each element of a `Vec<T>` with a given value. |
