refactor(parsing): remove old FromStr-based parser implementation
This commit is contained in:
parent
106c2547b5
commit
6b49d3ca14
9 changed files with 67 additions and 99 deletions
|
|
@ -29,16 +29,3 @@ impl std::fmt::Display for MetaCommandParseError {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::str::FromStr for MetaCommand {
|
||||
type Err = MetaCommandParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s.trim() {
|
||||
".exit" => Ok(MetaCommand::Exit),
|
||||
cmd => Err(MetaCommandParseError::Unrecognized {
|
||||
cmd: cmd.to_string(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue