pub enum Either<A, B> {
Left(A),
Right(B),
}
impl<A, B> Either<A, B> {
pub fn l(a: impl Into<A>) -> Self {
Self::Left(a.into())
}
pub fn r(b: impl Into<B>) -> Self {
Self::Right(b.into())
}
}
impl<A> Either<A, A> {
#[allow(clippy::missing_const_for_fn)] pub fn to_normal(self) -> A {
match self {
Self::Left(a) => a,
Self::Right(b) => b,
}
}
}