1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::ops::Not;

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Order {
    Ascending,
    Descending,
}

impl Not for Order {
    type Output = Self;

    fn not(self) -> Self::Output {
        match self {
            Self::Ascending => Self::Descending,
            Self::Descending => Self::Ascending,
        }
    }
}