#![allow(unused, clippy::match_single_binding)]
use std::fmt;
#[derive(Clone, Copy, PartialEq)]
pub struct Bool(pub u8);
impl Bool {
pub const FALSE: Bool = Bool(0);
pub const TRUE: Bool = Bool(1);
}
impl Default for Bool {
fn default() -> Self {
Self(u8::MAX)
}
}
impl fmt::Display for Bool {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "false"),
1 => write!(f, "true"),
_ => write!(f, "Bool({})", self.0),
}
}
}
impl fmt::Debug for Bool {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "Bool::FALSE(0)"),
1 => write!(f, "Bool::TRUE(1)"),
_ => write!(f, "Bool({})", self.0),
}
}
}