#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum TrimSide {
Left,
Right,
Both,
}
impl TrimSide {
pub fn from_char(c: char) -> Option<Self> {
match c {
'<' => Some(Self::Right),
'^' => Some(Self::Both),
'>' => Some(Self::Left),
_ => None,
}
}
pub fn left(&self) -> bool {
matches!(self, Self::Left | Self::Both)
}
pub fn right(&self) -> bool {
matches!(self, Self::Right | Self::Both)
}
}