1 2 3 4 5 6 7 8 9 10 11 12 13 14
#[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum Direction { Left = -1, Right = 1, } impl From<Direction> for i32 { fn from(value: Direction) -> Self { match value { Direction::Left => -1, Direction::Right => 1, } } }