Skip to content

Commit d829a5b

Browse files
authored
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
2 parents af1f46c + 2d1ab83 commit d829a5b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/alloc/src/vec.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ use crate::raw_vec::RawVec;
114114
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
115115
///
116116
/// // The following is equivalent, but potentially slower:
117-
/// let mut vec1 = Vec::with_capacity(5);
118-
/// vec1.resize(5, 0);
117+
/// let mut vec = Vec::with_capacity(5);
118+
/// vec.resize(5, 0);
119+
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
119120
/// ```
120121
///
121122
/// Use a `Vec<T>` as an efficient stack:

0 commit comments

Comments
 (0)