#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Axis {
Horizontal,
Vertical,
}
impl Axis {
#[inline]
pub fn cross_axis(self) -> Self {
match self {
Self::Horizontal => Self::Vertical,
Self::Vertical => Self::Horizontal,
}
}
#[inline]
pub fn is_horizontal(self) -> bool {
matches!(self, Self::Horizontal)
}
#[inline]
pub fn is_vertical(self) -> bool {
matches!(self, Self::Vertical)
}
}
#[cfg(test)]
#[path = "tests/axis_tests.rs"]
mod tests;