Skip to content

Commit 30560bb

Browse files
authored
Rollup merge of rust-lang#49452 - frewsxcv:frewsxcv-vec-cap-len, r=dtolnay
Clarify "length" wording in `Vec::with_capacity`. Fixes rust-lang#49448.
2 parents 03de75e + 0d15a3e commit 30560bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/liballoc/vec.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ impl<T> Vec<T> {
334334
/// The vector will be able to hold exactly `capacity` elements without
335335
/// reallocating. If `capacity` is 0, the vector will not allocate.
336336
///
337-
/// It is important to note that this function does not specify the *length*
338-
/// of the returned vector, but only the *capacity*. For an explanation of
339-
/// the difference between length and capacity, see *[Capacity and reallocation]*.
337+
/// It is important to note that although the returned vector has the
338+
/// *capacity* specified, the vector will have a zero *length*. For an
339+
/// explanation of the difference between length and capacity, see
340+
/// *[Capacity and reallocation]*.
340341
///
341342
/// [Capacity and reallocation]: #capacity-and-reallocation
342343
///

0 commit comments

Comments
 (0)