Implement std::fmt::Display for eval::Error
This commit is contained in:
1 parent
fab8c7c3a8
commit
45455d3a02
1 file changed
+8
@@ -21,3 +21,11 @@ pub trait Evaluator {
|
|||||||
|
|
||||||
fn eval(&mut self, input: Self::Expr) -> Result<Self::Expr, Self::Error>;
|
fn eval(&mut self, input: Self::Expr) -> Result<Self::Expr, Self::Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Display for Error {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "{}", match self {
|
||||||
|
Error::UnsupportedExpression => "Unsupported expression",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user