use std::fmt;
#[derive(Debug)]
pub struct Error {
details: String,
}
impl Error {
pub fn new(msg: String) -> Error {
Error { details: msg }
}
}
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
}
}