fn grow(&mut self) {
        if self.is_full() {
            let old_cap = self.cap();
            // Double the buffer size.
            self.buf.reserve_exact(old_cap, old_cap);
            assert!(self.cap() == old_cap * 2);
            unsafe {
                self.handle_capacity_increase(old_cap);
            }
            debug_assert!(!self.is_full());
        }
    }
Rearranges the internal storage of this deque so it is one contiguous
slice, which is then returned.

This method does not allocate and does not change the order of the
inserted elements. As it returns a mutable slice, this can be used to
sort a deque.

Once the internal storage is contiguous, the [`as_slices`] and
[`as_mut_slices`] methods will return the entire contents of the
`VecDeque` in a single slice.

[`as_slices`]: VecDeque::as_slices
[`as_mut_slices`]: VecDeque::as_mut_slices

# Examples

Sorting the content of a deque.

```
use std::collections::VecDeque;

let mut buf = VecDeque::with_capacity(15);

buf.push_back(2);
buf.push_back(1);
buf.push_front(3);

// sorting the deque
buf.make_contiguous().sort();
assert_eq!(buf.as_slices(), (&[1, 2, 3] as &[_], &[] as &[_]));

// sorting it in reverse order
buf.make_contiguous().sort_by(|a, b| b.cmp(a));
assert_eq!(buf.as_slices(), (&[3, 2, 1] as &[_], &[] as &[_]));
```

Getting immutable access to the contiguous slice.

``
benchmarks/haystacks/code/rust-library.rs