use std::fmt;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Error {
message: String,
}
pub type Result<T> = std::result::Result<T, Error>;
impl Error {
pub(crate) fn new(message: impl Into<String>) -> Self {
Self {
message: message.into(),
}
}
}
impl fmt::Display for Error {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(&self.message)
}
}
impl std::error::Error for Error {}