1 2 3 4 5 6 7 8 9 10 11 12
#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum SelectionType { File, Directory, Any, } impl SelectionType { pub fn respects(self, constraint: Self) -> bool { constraint == Self::Any || self == constraint } }
1 2 3 4 5 6 7 8 9 10 11 12
#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum SelectionType { File, Directory, Any, } impl SelectionType { pub fn respects(self, constraint: Self) -> bool { constraint == Self::Any || self == constraint } }