@@ -358,7 +358,7 @@ mod spec_extend;
358
358
///
359
359
/// `vec![x; n]`, `vec![a, b, c, d]`, and
360
360
/// [`Vec::with_capacity(n)`][`Vec::with_capacity`], will all produce a `Vec`
361
- /// with exactly the requested capacity. If <code>[len] == [capacity]</code>,
361
+ /// with at least the requested capacity. If <code>[len] == [capacity]</code>,
362
362
/// (as is the case for the [`vec!`] macro), then a `Vec<T>` can be converted to
363
363
/// and from a [`Box<[T]>`][owned slice] without reallocating or moving the elements.
364
364
///
@@ -1025,8 +1025,9 @@ impl<T, A: Allocator> Vec<T, A> {
1025
1025
///
1026
1026
/// The behavior of this method depends on the allocator being used. If the allocator supports
1027
1027
/// in-place shrinking, some or all of the excess capacity may be returned to the allocator.
1028
- /// If not, this method may cause the vector's data to be copied to a new allocation with
1029
- /// exactly the correct size. See [`Allocator::shrink`] for more details.
1028
+ /// If not, this method may cause the vector's data to be copied to a new allocation, although
1029
+ /// no guarantees are given that this new allocation is actually smaller. See
1030
+ /// [`Allocator::shrink`] for more details.
1030
1031
///
1031
1032
/// # Examples
1032
1033
///
@@ -1076,7 +1077,7 @@ impl<T, A: Allocator> Vec<T, A> {
1076
1077
1077
1078
/// Converts the vector into [`Box<[T]>`][owned slice].
1078
1079
///
1079
- /// Before doing the conversion, this method calls [`shrink_to_fit`] to remove excess capacity .
1080
+ /// Before doing the conversion, this method discards excess capacity like [`shrink_to_fit`].
1080
1081
///
1081
1082
/// [owned slice]: Box
1082
1083
/// [`shrink_to_fit`]: Vec::shrink_to_fit
@@ -3290,10 +3291,12 @@ impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
3290
3291
#[ cfg( not( test) ) ]
3291
3292
#[ stable( feature = "box_from_vec" , since = "1.20.0" ) ]
3292
3293
impl < T , A : Allocator > From < Vec < T , A > > for Box < [ T ] , A > {
3293
- /// Convert a vector into a boxed slice.
3294
+ /// Converts a vector into [`Box<[T]>`][owned slice] .
3294
3295
///
3295
- /// If `v` has excess capacity, its items will be moved into a
3296
- /// newly-allocated buffer with exactly the right capacity.
3296
+ /// Before doing the conversion, this method discards excess capacity like [`Vec::shrink_to_fit`].
3297
+ ///
3298
+ /// [owned slice]: Box
3299
+ /// [`Vec::shrink_to_fit`]: Vec::shrink_to_fit
3297
3300
///
3298
3301
/// # Examples
3299
3302
///
0 commit comments