use std::fmt;
#[derive(Debug)]
pub struct Error {
details: String,
}
impl Error {
pub(crate) fn new(msg: &str) -> Self {
Error {
details: msg.to_string(),
}
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.details)
}
}
impl ::std::error::Error for Error {
fn description(&self) -> &str {
&self.details
}
}