use std::{error, fmt};
#[derive(Debug, Clone, Copy)]
#[non_exhaustive]
pub enum Error {
NotEnoughData,
IncorrectFormat,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::NotEnoughData => write!(
f,
"There is not enough underlying raw data to construct an `Arbitrary` instance"
),
Error::IncorrectFormat => write!(
f,
"The raw data is not of the correct format to construct this type"
),
}
}
}
impl error::Error for Error {}
pub type Result<T> = std::result::Result<T, Error>;