broot/tree/
sort.rs

1/// A sort key.
2/// A non None sort mode implies only one level of the tree
3/// is displayed.
4/// When in None mode, paths are alpha sorted
5#[derive(Debug, Clone, Copy, PartialEq)]
6pub enum Sort {
7    None,
8    Count,
9    Date,
10    Size,
11    TypeDirsFirst,
12    TypeDirsLast,
13}
14
15impl Sort {
16    pub fn prevent_deep_display(self) -> bool {
17        match self {
18            Self::None => false,
19            Self::Count => true,
20            Self::Date => true,
21            Self::Size => true,
22            Self::TypeDirsFirst => false,
23            Self::TypeDirsLast => false,
24        }
25    }
26}