1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::head_tail::HeadTail;

pub trait PopFront {
    type Output;
    fn pop_front(self) -> Self::Output;
}

impl<T> PopFront for T
where
    T: HeadTail,
{
    type Output = T::Tail;

    fn pop_front(self) -> Self::Output {
        self.head_tail().1
    }
}