diff --git a/src/error.rs b/src/error.rs index d5189c3..ee50813 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,4 +1,4 @@ -use std::fmt; +use std::{error::Error as StdError, fmt}; #[derive(Debug)] pub enum Error { @@ -32,6 +32,8 @@ pub enum Error { ExpectBinOpToken, } +impl StdError for Error {} + #[cfg(not(tarpaulin_include))] impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/src/lib.rs b/src/lib.rs index c8c55ed..bd7e949 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,6 +169,7 @@ fn init() { pub type Value = value::Value; pub type Context = context::Context; pub type Result = define::Result; +pub type Error = error::Error; pub type ExprAST<'a> = parser::ExprAST<'a>; pub type InfixOpType = operator::InfixOpType; pub type InfixOpAssociativity = operator::InfixOpAssociativity;