crate enum Either { Left(L), Right(R), } impl std::fmt::Debug for Either 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(), } } }