Skip to content

Commit 2da4f9a

Browse files
scottmcmCentril
andcommitted
Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <[email protected]>
1 parent cc2a280 commit 2da4f9a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/liballoc/collections/vec_deque.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,28 +2707,28 @@ impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
27072707
}
27082708
}
27092709

2710-
/// Turn a `Vec` into a `VecDeque`.
2710+
/// Turn a `Vec<T>` into a `VecDeque<T>`.
27112711
///
27122712
/// This avoids reallocating where possible, but the conditions for that are
2713-
/// strict, and subject to change, so shouldn't be relied upon unless the
2714-
/// `Vec` came from `From<VecDeque>` has hasn't been reallocated.
2713+
/// strict, and subject to change, and so shouldn't be relied upon unless the
2714+
/// `Vec<T>` came from `From<VecDeque<T>>` has hasn't been reallocated.
27152715
///
27162716
/// # Examples
27172717
///
27182718
/// ```
27192719
/// use std::collections::VecDeque;
27202720
///
2721-
/// // Start with a VecDeque
2721+
/// // Start with a `VecDeque<i32>`.
27222722
/// let deque: VecDeque<_> = (1..5).collect();
27232723
///
2724-
/// // Turn it into a Vec (no allocation needed)
2724+
/// // Turn it into a `Vec<i32>` with no allocation needed.
27252725
/// let mut vec = Vec::from(deque);
27262726
///
2727-
/// // modify it, being careful to not trigger reallocation
2727+
/// // Modify it, being careful not to trigger reallocation.
27282728
/// vec.pop();
27292729
/// vec.push(100);
27302730
///
2731-
/// // Turn it back into a VecDeque (no allocation needed)
2731+
/// // Turn it back into a `VecDeque<i32>` with no allocation needed.
27322732
/// let ptr = vec.as_ptr();
27332733
/// let deque = VecDeque::from(vec);
27342734
/// assert_eq!(deque, [1, 2, 3, 100]);
@@ -2760,7 +2760,7 @@ impl<T> From<Vec<T>> for VecDeque<T> {
27602760
}
27612761
}
27622762

2763-
/// Turn a `VecDeque` into a `Vec`.
2763+
/// Turn a `VecDeque<T>` into a `Vec<T>`.
27642764
///
27652765
/// This never needs to re-allocate, but does need to do O(n) data movement if
27662766
/// the circular buffer doesn't happen to be at the beginning of the allocation.
@@ -2770,14 +2770,14 @@ impl<T> From<Vec<T>> for VecDeque<T> {
27702770
/// ```
27712771
/// use std::collections::VecDeque;
27722772
///
2773-
/// // This one is O(1)
2773+
/// // This one is O(1).
27742774
/// let deque: VecDeque<_> = (1..5).collect();
27752775
/// let ptr = deque.as_slices().0.as_ptr();
27762776
/// let vec = Vec::from(deque);
27772777
/// assert_eq!(vec, [1, 2, 3, 4]);
27782778
/// assert_eq!(vec.as_ptr(), ptr);
27792779
///
2780-
/// // This one need data rearranging
2780+
/// // This one needs data rearranging.
27812781
/// let mut deque: VecDeque<_> = (1..5).collect();
27822782
/// deque.push_front(9);
27832783
/// deque.push_front(8);

0 commit comments

Comments
 (0)