Multiple Values
We can match
on multiple values by wrapping them in a tuple and then specifying each variant in the same structure (tuple) that they have been defined.
use core::ops::Eq;
enum Binary {
True: (),
False: (),
}
impl Eq for Binary {
fn eq(self, other: Self) -> bool {
match (self, other) {
(Binary::True, Binary::True) => true,
(Binary::False, Binary::False) => true,
_ => false,
}
}
}