lodestone-scraper/src/util/either.rs

17 lines
398 B
Rust
Raw Normal View History

2022-06-16 14:12:13 +00:00
pub(crate) enum Either<L, R> {
2018-09-04 20:13:11 +00:00
Left(L),
Right(R),
}
impl<L, R> std::fmt::Debug for Either<L, R>
where L: std::fmt::Debug,
R: std::fmt::Debug,
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match *self {
Either::Left(ref l) => f.debug_tuple("Left").field(l).finish(),
Either::Right(ref r) => f.debug_tuple("Right").field(r).finish(),
}
}
}