LexError directly to ParseError.

This commit is contained in:
Stephen Chung
2020-12-22 11:55:51 +08:00
parent 8c41e549f7
commit 10da4d8976
2 changed files with 17 additions and 23 deletions

View File

@@ -119,11 +119,10 @@ pub fn from_dynamic<'de, T: Deserialize<'de>>(
impl Error for Box<EvalAltResult> {
fn custom<T: fmt::Display>(err: T) -> Self {
EvalAltResult::ErrorParsing(
ParseErrorType::BadInput(LexError::ImproperSymbol("".to_string(), err.to_string())),
Position::NONE,
)
.into()
LexError::ImproperSymbol("".to_string(), err.to_string())
.into_err(Position::NONE)
.into()
.into()
}
}