#![allow(unused, clippy::match_single_binding)]
use std::fmt;
#[derive(Clone, Copy, PartialEq)]
pub struct Intensity(pub u8);
impl Intensity {
pub const ACTIVE: Intensity = Intensity(0);
pub const REST: Intensity = Intensity(1);
pub const WARMUP: Intensity = Intensity(2);
pub const COOLDOWN: Intensity = Intensity(3);
pub const RECOVERY: Intensity = Intensity(4);
pub const INTERVAL: Intensity = Intensity(5);
pub const OTHER: Intensity = Intensity(6);
}
impl Default for Intensity {
fn default() -> Self {
Self(u8::MAX)
}
}
impl fmt::Display for Intensity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "active"),
1 => write!(f, "rest"),
2 => write!(f, "warmup"),
3 => write!(f, "cooldown"),
4 => write!(f, "recovery"),
5 => write!(f, "interval"),
6 => write!(f, "other"),
_ => write!(f, "Intensity({})", self.0),
}
}
}
impl fmt::Debug for Intensity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
0 => write!(f, "Intensity::ACTIVE(0)"),
1 => write!(f, "Intensity::REST(1)"),
2 => write!(f, "Intensity::WARMUP(2)"),
3 => write!(f, "Intensity::COOLDOWN(3)"),
4 => write!(f, "Intensity::RECOVERY(4)"),
5 => write!(f, "Intensity::INTERVAL(5)"),
6 => write!(f, "Intensity::OTHER(6)"),
_ => write!(f, "Intensity({})", self.0),
}
}
}