use alloc::borrow::Cow;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
InvalidData(Cow<'static, str>),
Unsupported(Cow<'static, str>),
}
pub type Result<T> = core::result::Result<T, Error>;
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::InvalidData(message) => write!(f, "invalid data: {message}"),
Self::Unsupported(message) => write!(f, "unsupported: {message}"),
}
}
}
impl core::error::Error for Error {}