parent
1481fd964b
commit
674cd6125d
@ -868,13 +868,14 @@ pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A) {
|
|||||||
(ptr, len, capacity, alloc)
|
(ptr, len, capacity, alloc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the number of elements the vector can hold without
|
/// Returns the total number of elements the vector can hold without
|
||||||
/// reallocating.
|
/// reallocating.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let vec: Vec<i32> = Vec::with_capacity(10);
|
/// let mut vec: Vec<i32> = Vec::with_capacity(10);
|
||||||
|
/// vec.push(42);
|
||||||
/// assert_eq!(vec.capacity(), 10);
|
/// assert_eq!(vec.capacity(), 10);
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
Reference in New Issue
Block a user