1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use super::*;
use core::marker::PhantomData;
pub struct Empty<T, E>(E, PhantomData<T>);
impl<T, E> ListFn for Empty<T, E> {
type Item = T;
type End = E;
fn next(self) -> ListState<Self> {
ListState::End(self.0)
}
}
impl<T, E> Empty<T, E> {
pub fn new(e: E) -> Self {
Empty(e, PhantomData::default())
}
}