#[derive(Debug, Clone, Copy)]
pub enum Either<L, R> {
Left(L),
Right(R),
}
impl<L, R> Either<L, R> {
pub fn left(self) -> Option<L> {
match self {
Either::Left(l) => Some(l),
_ => None,
}
}
pub fn right(self) -> Option<R> {
match self {
Either::Right(r) => Some(r),
_ => None,
}
}
}