Skip to main content

trey/header/
dimensional_code.rs

1use std::fmt;
2
3#[derive(Debug, PartialEq)]
4pub enum DimensionalCode {
5    D2,
6    D3,
7}
8
9impl Default for DimensionalCode {
10    fn default() -> Self {
11        Self::D2
12    }
13}
14
15impl fmt::Display for DimensionalCode {
16    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17        write!(
18            f,
19            "{}",
20            match self {
21                Self::D2 => "2D",
22                Self::D3 => "3D",
23            }
24        )
25    }
26}