refactor(error_report): remove dead code
This commit is contained in:
parent
620259af48
commit
faedfadeab
5 changed files with 7 additions and 70 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::meta_commands::{MetaCommand, MetaCommandExecuteResult, MetaCommandParseError};
|
||||
use crate::statements::{Statement, StatementExecuteResult, StatementParseError};
|
||||
use crate::meta_commands::{MetaCommand, MetaCommandExecuteResult};
|
||||
use crate::statements::{Statement, StatementExecuteResult};
|
||||
use crate::tokens::ScanError;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -49,45 +49,21 @@ impl Command {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub enum CommandParseError {
|
||||
MetaCommand(MetaCommandParseError),
|
||||
Statement(StatementParseError),
|
||||
Scan(ScanError),
|
||||
}
|
||||
|
||||
impl CommandParseError {
|
||||
pub(crate) fn message(&self) -> String {
|
||||
match self {
|
||||
CommandParseError::MetaCommand(x) => format!("{x}"),
|
||||
CommandParseError::Statement(x) => format!("{x}"),
|
||||
CommandParseError::Scan(x) => format!("{x}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MetaCommand> for Command {
|
||||
fn from(value: MetaCommand) -> Self {
|
||||
Command::MetaCommand(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<MetaCommandParseError> for CommandParseError {
|
||||
fn from(value: MetaCommandParseError) -> Self {
|
||||
CommandParseError::MetaCommand(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Statement> for Command {
|
||||
fn from(value: Statement) -> Self {
|
||||
Command::Statement(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<StatementParseError> for CommandParseError {
|
||||
fn from(value: StatementParseError) -> Self {
|
||||
CommandParseError::Statement(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ScanError> for CommandParseError {
|
||||
fn from(value: ScanError) -> Self {
|
||||
CommandParseError::Scan(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue