use std::{error, fmt, result};
pub type Result<T> = result::Result<T, Error>;
#[derive(Debug)]
pub enum Error {
BadJson(simd_json::Error),
Rope(&'static str),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::BadJson(err) => write!(f, "bad json: {err}"),
Error::Rope(err) => write!(f, "rope error: {err}"),
}
}
}
impl error::Error for Error {}
impl From<simd_json::Error> for Error {
fn from(err: simd_json::Error) -> Error {
Error::BadJson(err)
}
}