use crate::ErrorKind;
use std::str::FromStr;
pub enum Command {
S,
Empty,
}
impl FromStr for Command {
type Err = ErrorKind;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"" => Ok(Command::Empty),
"s" => Ok(Command::S),
cmd => Err(ErrorKind::UnknownCommand(cmd.into())),
}
}
}