Skip to content

Commit 0150448

Browse files
committed
Remove the questionably-useful example
1 parent 5168f5d commit 0150448

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/liballoc/collections/vec_deque.rs

-22
Original file line numberDiff line numberDiff line change
@@ -2714,28 +2714,6 @@ impl<T> From<Vec<T>> for VecDeque<T> {
27142714
/// This avoids reallocating where possible, but the conditions for that are
27152715
/// strict, and subject to change, and so shouldn't be relied upon unless the
27162716
/// `Vec<T>` came from `From<VecDeque<T>>` and hasn't been reallocated.
2717-
///
2718-
/// # Examples
2719-
///
2720-
/// ```
2721-
/// use std::collections::VecDeque;
2722-
///
2723-
/// // Start with a `VecDeque<i32>`.
2724-
/// let deque: VecDeque<_> = (1..5).collect();
2725-
///
2726-
/// // Turn it into a `Vec<i32>` with no allocation needed.
2727-
/// let mut vec = Vec::from(deque);
2728-
///
2729-
/// // Modify it, being careful not to trigger reallocation.
2730-
/// vec.pop();
2731-
/// vec.push(100);
2732-
///
2733-
/// // Turn it back into a `VecDeque<i32>` with no allocation needed.
2734-
/// let ptr = vec.as_ptr();
2735-
/// let deque = VecDeque::from(vec);
2736-
/// assert_eq!(deque, [1, 2, 3, 100]);
2737-
/// assert_eq!(deque.as_slices().0.as_ptr(), ptr);
2738-
/// ```
27392717
fn from(mut other: Vec<T>) -> Self {
27402718
unsafe {
27412719
let other_buf = other.as_mut_ptr();

0 commit comments

Comments
 (0)