use roto::RotoReport;
use std::fmt;
#[derive(Debug)]
pub enum Error {
Report(RotoReport),
String(String),
}
impl std::error::Error for Error {}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Report(r) => write!(f, "{r}"),
Self::String(s) => write!(f, "{s}"),
}
}
}
impl From<RotoReport> for Error {
fn from(r: RotoReport) -> Self {
Self::Report(r)
}
}
impl From<String> for Error {
fn from(s: String) -> Self {
Self::String(s)
}
}