use std::error::Error;
use std::{fmt, result};
pub type Result<T, E = FindSimdocError> = result::Result<T, E>;
#[derive(Debug)]
pub enum FindSimdocError {
Input(InputError),
}
impl fmt::Display for FindSimdocError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Input(e) => e.fmt(f),
}
}
}
impl Error for FindSimdocError {}
impl FindSimdocError {
pub(crate) const fn input(msg: &'static str) -> Self {
Self::Input(InputError { msg })
}
}
#[derive(Debug)]
pub struct InputError {
msg: &'static str,
}
impl fmt::Display for InputError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "InputError: {}", self.msg)
}
}