1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#[derive(PartialEq, Clone, Debug, Default)]
pub enum Alignment {
    #[default]
    Start,
    Center,
    End,
    SpaceBetween,
    SpaceEvenly,
    SpaceAround,
}

impl Alignment {
    pub fn is_not_start(&self) -> bool {
        *self != Self::Start
    }

    pub fn is_spaced(&self) -> bool {
        matches!(
            self,
            Self::SpaceBetween | Self::SpaceAround | Self::SpaceEvenly
        )
    }

    pub fn pretty(&self) -> String {
        match self {
            Alignment::Start => "start".to_string(),
            Alignment::Center => "center".to_string(),
            Alignment::End => "end".to_string(),
            Alignment::SpaceBetween => "space-between".to_string(),
            Alignment::SpaceEvenly => "space-evenly".to_string(),
            Alignment::SpaceAround => "space-around".to_string(),
        }
    }
}