pub fn rotate_right(&mut self, k: usize) {
        assert!(k <= self.len());
        let mid = self.len() - k;
        if k <= mid {
            unsafe { self.rotate_right_inner(k) }
        } else {
            unsafe { self.rotate_left_inner(mid) }
        }
    }
Binary searches this sorted `VecDeque` for a given element.

If the value is found then [`Result::Ok`] is returned, containing the
index of the matching element. If there are multiple matches, then any
one of the matches could be returned. If the value is not found then
[`Result::Err`] is returned, containing the index where a matching
element could be inserted while maintaining sorted order.

See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].

[`binary_search_by`]: VecDeque::binary_search_by
[`binary_search_by_key`]: VecDeque::binary_search_by_key
[`partition_point`]: VecDeque::partition_point

# Examples

Looks up a series of four elements. The first is found, with a
uniquely determined position; the second and third are not
found; the fourth could match any position in `[1, 4]`.

```
#![feature(vecdeque_binary_search)]
use std::collections::VecDeque;

let deque: VecDeque<_> = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55].into();

assert_eq!(deque.binary_search(&13),  Ok(9));
assert_eq!(deque.binary_search(&4),   Err(7));
assert_eq!(deque.binary_search(&100), Err(13));
let r = deque.binary_search(&1);
assert!(matches!(r, Ok(1..=4)));
```

If you want to insert an item to a sorted `VecDeque`, while maintaining
sort or
benchmarks/haystacks/code/rust-library.rs