use core::cmp::{self};
use core::mem::replace;
+use crate::alloc::Allocator;
+
use super::VecDeque;
/// PairSlices pairs up equal length slice parts of two deques
///
/// and the uneven remainder of either A or B is skipped.
pub struct PairSlices<'a, 'b, T> {
- pub(crate) a0: &'a mut [T],
- pub(crate) a1: &'a mut [T],
- pub(crate) b0: &'b [T],
- pub(crate) b1: &'b [T],
+ a0: &'a mut [T],
+ a1: &'a mut [T],
+ b0: &'b [T],
+ b1: &'b [T],
}
impl<'a, 'b, T> PairSlices<'a, 'b, T> {
- pub fn from(to: &'a mut VecDeque<T>, from: &'b VecDeque<T>) -> Self {
+ pub fn from<A: Allocator>(to: &'a mut VecDeque<T, A>, from: &'b VecDeque<T, A>) -> Self {
let (a0, a1) = to.as_mut_slices();
let (b0, b1) = from.as_slices();
PairSlices { a0, a1, b0, b1 }