#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Error {
message: String,
}
impl Error {
pub fn new(message: impl ToString) -> Self {
Self {
message: message.to_string(),
}
}
}
impl std::fmt::Display for Error {
fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
self.message.fmt(formatter)
}
}
impl std::error::Error for Error {}