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