@@ -2796,7 +2796,7 @@ impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
2796
2796
///
2797
2797
/// # Allocation behavior
2798
2798
///
2799
- /// In general `Vec` does not guarantee any particular grow/ allocation stategy .
2799
+ /// In general `Vec` does not guarantee any particular growth or allocation strategy .
2800
2800
/// That also applies to this trait impl.
2801
2801
///
2802
2802
/// **Note:** This section covers implementation details and is therefore exempt from
@@ -2812,14 +2812,14 @@ impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
2812
2812
///
2813
2813
/// The last case warrants some attention. It is an optimization that in many cases reduces peak memory
2814
2814
/// consumption and improves cache locality. But when a large number of big, short-lived
2815
- /// allocations are created, only a small fraction of their items gets collected, no further use
2816
- /// is made of the spare capacity and the resulting `Vec` is moved into a longer-lived structure
2815
+ /// allocations are created, and only a small fraction of their items get collected, no further use
2816
+ /// is made of the spare capacity. If the resulting `Vec` is moved into a longer-lived structure,
2817
2817
/// this can lead to the large allocations having their lifetimes unnecessarily extended which
2818
2818
/// can result in increased memory footprint.
2819
2819
///
2820
- /// In cases where this is an issue the excess capacity can be discard with [`Vec::shrink_to()`],
2821
- /// [`Vec::shrink_to_fit()`] or by collecting into [`Box<[T]>`][owned slice] instead which additionally reduces
2822
- /// the size of the longlived struct.
2820
+ /// In cases where this is an issue, the excess capacity can be discard with [`Vec::shrink_to()`],
2821
+ /// [`Vec::shrink_to_fit()`] or by collecting into [`Box<[T]>`][owned slice] instead, which additionally reduces
2822
+ /// the size of the long-lived struct.
2823
2823
///
2824
2824
/// [owned slice]: Box
2825
2825
///
0 commit comments