1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Parse;
use torin::display::DisplayMode;

#[derive(Debug, PartialEq, Eq)]
pub struct ParseDisplayModeError;

impl Parse for DisplayMode {
    type Err = ParseDisplayModeError;

    fn parse(value: &str) -> Result<Self, Self::Err> {
        Ok(match value {
            "center" => DisplayMode::Center,
            _ => DisplayMode::Normal,
        })
    }
}