Rollup merge of #49452 - frewsxcv:frewsxcv-vec-cap-len, r=dtolnay

Clarify "length" wording in `Vec::with_capacity`.

Fixes https://github.com/rust-lang/rust/issues/49448.
This commit is contained in:
kennytm
2018-03-28 17:55:20 +02:00
committed by GitHub

View File

@@ -334,9 +334,10 @@ impl<T> Vec<T> {
/// The vector will be able to hold exactly `capacity` elements without /// The vector will be able to hold exactly `capacity` elements without
/// reallocating. If `capacity` is 0, the vector will not allocate. /// reallocating. If `capacity` is 0, the vector will not allocate.
/// ///
/// It is important to note that this function does not specify the *length* /// It is important to note that although the returned vector has the
/// of the returned vector, but only the *capacity*. For an explanation of /// *capacity* specified, the vector will have a zero *length*. For an
/// the difference between length and capacity, see *[Capacity and reallocation]*. /// explanation of the difference between length and capacity, see
/// *[Capacity and reallocation]*.
/// ///
/// [Capacity and reallocation]: #capacity-and-reallocation /// [Capacity and reallocation]: #capacity-and-reallocation
/// ///