1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::ImpVec;
use orx_split_vec::{SplitVec, SplitVecGrowth};
use std::ops::{Deref, DerefMut};

impl<T, G> Deref for ImpVec<T, G>
where
    G: SplitVecGrowth<T>,
{
    type Target = SplitVec<T, G>;
    fn deref(&self) -> &Self::Target {
        unsafe { &*self.as_mut_ptr() }
    }
}

impl<T, G> DerefMut for ImpVec<T, G>
where
    G: SplitVecGrowth<T>,
{
    fn deref_mut(&mut self) -> &mut Self::Target {
        unsafe { &mut *self.as_mut_ptr() }
    }
}