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

pub enum OptionList<I, E> {
    Some { first: I, end: E },
    End(E),
}

impl<I, E> ListFn for OptionList<I, E> {
    type Item = I;
    type End = E;
    fn next(self) -> ListState<Self> {
        match self {
            OptionList::Some { first, end } => ListState::some(first, OptionList::End(end)),
            OptionList::End(end) => ListState::End(end),
        }
    }
}