2022-08-04 16:43:51 +03:00
|
|
|
use std::fmt::Display;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
2022-08-08 02:16:02 +03:00
|
|
|
pub enum Error {
|
2022-08-09 18:56:21 +03:00
|
|
|
DuplicateAttrsKey {
|
|
|
|
key: String,
|
|
|
|
},
|
|
|
|
|
2022-08-08 02:16:02 +03:00
|
|
|
TypeError {
|
|
|
|
expected: &'static str,
|
|
|
|
actual: &'static str,
|
|
|
|
},
|
|
|
|
}
|
2022-08-04 16:43:51 +03:00
|
|
|
|
|
|
|
impl Display for Error {
|
|
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2022-08-09 17:46:51 +03:00
|
|
|
writeln!(f, "{:?}", self)
|
2022-08-04 16:43:51 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type EvalResult<T> = Result<T, Error>;
|