use std::fmt;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum OxidationSign {
Positive,
Negative,
Zero,
}
impl OxidationSign {
#[must_use]
pub const fn is_positive(self) -> bool {
matches!(self, Self::Positive)
}
#[must_use]
pub const fn is_negative(self) -> bool {
matches!(self, Self::Negative)
}
#[must_use]
pub const fn is_zero(self) -> bool {
matches!(self, Self::Zero)
}
}
impl fmt::Display for OxidationSign {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Positive => formatter.write_str("+"),
Self::Negative => formatter.write_str("-"),
Self::Zero => formatter.write_str("0"),
}
}
}