Skip to content

Commit 2cddfa5

Browse files
the8472cuviper
andauthored
Apply suggestions from code review
Co-authored-by: Josh Stone <cuviper@gmail.com>
1 parent 8888bfc commit 2cddfa5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/alloc/src/vec/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2798,14 +2798,14 @@ impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
27982798
/// depending on the supplied iterator:
27992799
///
28002800
/// * preallocate based on [`Iterator::size_hint()`]
2801-
/// * and panic if the number of items is not outside the provided lower/upper bounds
2801+
/// * and panic if the number of items is outside the provided lower/upper bounds
28022802
/// * use an amortized growth strategy similar to `pushing` one item at a time
28032803
/// * perform the iteration in-place on the original allocation backing the iterator
28042804
///
28052805
/// The last case warrants some attention. It is an optimization that in many cases reduces peak memory
28062806
/// consumption and improves cache locality. But when big, short-lived allocations are created,
2807-
/// only a small fraction of their items gets collected, no further use is made of the spare capacity
2808-
/// and the resulting `Vec` is moved into a longer-lived structure this can lead to the large
2807+
/// only a small fraction of their items get collected, no further use is made of the spare capacity
2808+
/// and the resulting `Vec` is moved into a longer-lived structure, then this can lead to the large
28092809
/// allocations having their lifetimes unnecessarily extended which can result in increased memory
28102810
/// footprint.
28112811
///

0 commit comments

Comments
 (0)