use std::{default::Default, ops::Not};
use Cell::*;
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Cell {
Zero,
One,
Empty,
}
impl Default for Cell {
fn default() -> Self {
Empty
}
}
impl Not for Cell {
type Output = Self;
fn not(self) -> Self {
match self {
Zero => One,
One => Zero,
Empty => Empty,
}
}
}
impl Cell {
pub fn is_empty(self) -> bool {
matches!(self, Empty)
}
pub fn is_filled(self) -> bool {
!matches!(self, Empty)
}
}