@@ -2707,28 +2707,28 @@ impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
2707
2707
}
2708
2708
}
2709
2709
2710
- /// Turn a `Vec` into a `VecDeque`.
2710
+ /// Turn a `Vec<T> ` into a `VecDeque<T> `.
2711
2711
///
2712
2712
/// 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.
2715
2715
///
2716
2716
/// # Examples
2717
2717
///
2718
2718
/// ```
2719
2719
/// use std::collections::VecDeque;
2720
2720
///
2721
- /// // Start with a VecDeque
2721
+ /// // Start with a ` VecDeque<i32>`.
2722
2722
/// let deque: VecDeque<_> = (1..5).collect();
2723
2723
///
2724
- /// // Turn it into a Vec ( no allocation needed)
2724
+ /// // Turn it into a ` Vec<i32>` with no allocation needed.
2725
2725
/// let mut vec = Vec::from(deque);
2726
2726
///
2727
- /// // modify it, being careful to not trigger reallocation
2727
+ /// // Modify it, being careful not to trigger reallocation.
2728
2728
/// vec.pop();
2729
2729
/// vec.push(100);
2730
2730
///
2731
- /// // Turn it back into a VecDeque ( no allocation needed)
2731
+ /// // Turn it back into a ` VecDeque<i32>` with no allocation needed.
2732
2732
/// let ptr = vec.as_ptr();
2733
2733
/// let deque = VecDeque::from(vec);
2734
2734
/// assert_eq!(deque, [1, 2, 3, 100]);
@@ -2760,7 +2760,7 @@ impl<T> From<Vec<T>> for VecDeque<T> {
2760
2760
}
2761
2761
}
2762
2762
2763
- /// Turn a `VecDeque` into a `Vec`.
2763
+ /// Turn a `VecDeque<T> ` into a `Vec<T> `.
2764
2764
///
2765
2765
/// This never needs to re-allocate, but does need to do O(n) data movement if
2766
2766
/// 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> {
2770
2770
/// ```
2771
2771
/// use std::collections::VecDeque;
2772
2772
///
2773
- /// // This one is O(1)
2773
+ /// // This one is O(1).
2774
2774
/// let deque: VecDeque<_> = (1..5).collect();
2775
2775
/// let ptr = deque.as_slices().0.as_ptr();
2776
2776
/// let vec = Vec::from(deque);
2777
2777
/// assert_eq!(vec, [1, 2, 3, 4]);
2778
2778
/// assert_eq!(vec.as_ptr(), ptr);
2779
2779
///
2780
- /// // This one need data rearranging
2780
+ /// // This one needs data rearranging.
2781
2781
/// let mut deque: VecDeque<_> = (1..5).collect();
2782
2782
/// deque.push_front(9);
2783
2783
/// deque.push_front(8);
0 commit comments