Move boxing of ParseError into ParseErrorType.

This commit is contained in:
Stephen Chung
2020-05-22 18:28:13 +08:00
parent 2f0ab18b70
commit e224550861
7 changed files with 59 additions and 65 deletions

View File

@@ -23,7 +23,7 @@ use crate::stdlib::path::PathBuf;
#[derive(Debug)]
pub enum EvalAltResult {
/// Syntax error.
ErrorParsing(Box<ParseError>),
ErrorParsing(ParseError),
/// Error reading from a script file. Wrapped value is the path of the script file.
///
@@ -241,11 +241,6 @@ impl fmt::Display for EvalAltResult {
impl From<ParseError> for Box<EvalAltResult> {
fn from(err: ParseError) -> Self {
Box::new(EvalAltResult::ErrorParsing(Box::new(err)))
}
}
impl From<Box<ParseError>> for Box<EvalAltResult> {
fn from(err: Box<ParseError>) -> Self {
Box::new(EvalAltResult::ErrorParsing(err))
}
}