impl From<[(K, V); N]> for std::collections
This commit is contained in:
parent
7953910464
commit
2db05230d3
12 changed files with 244 additions and 26 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue