Skip to content

Commit

Permalink
Clarify "length" wording in Vec::with_capacity.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Mar 28, 2018
1 parent bcffdf1 commit 0d15a3e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/liballoc/vec.rs
Expand Up @@ -334,9 +334,10 @@ impl<T> Vec<T> {
/// The vector will be able to hold exactly `capacity` elements without
/// reallocating. If `capacity` is 0, the vector will not allocate.
///
/// It is important to note that this function does not specify the *length*
/// of the returned vector, but only the *capacity*. For an explanation of
/// the difference between length and capacity, see *[Capacity and reallocation]*.
/// It is important to note that although the returned vector has the
/// *capacity* specified, the vector will have a zero *length*. For an
/// explanation of the difference between length and capacity, see
/// *[Capacity and reallocation]*.
///
/// [Capacity and reallocation]: #capacity-and-reallocation
///
Expand Down

0 comments on commit 0d15a3e

Please sign in to comment.