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