Rollup merge of #76058 - pickfire:patch-11, r=jyn514
Use assertions on Vec doc Clarify what the state of Vec after with_capacity on doc. r? @jyn514
This commit is contained in:
commit
d829a5bcb1
@ -114,8 +114,9 @@ use crate::raw_vec::RawVec;
|
||||
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
|
||||
///
|
||||
/// // The following is equivalent, but potentially slower:
|
||||
/// let mut vec1 = Vec::with_capacity(5);
|
||||
/// vec1.resize(5, 0);
|
||||
/// let mut vec = Vec::with_capacity(5);
|
||||
/// vec.resize(5, 0);
|
||||
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
|
||||
/// ```
|
||||
///
|
||||
/// Use a `Vec<T>` as an efficient stack:
|
||||
|
Loading…
Reference in New Issue
Block a user