use core::{fmt, num::ParseIntError};
#[allow(clippy::module_name_repetitions)]
#[derive(Clone, Eq, PartialEq, Debug)]
#[non_exhaustive]
pub enum ParseEtherTypeError {
InvalidLength,
ParseInt(ParseIntError),
}
impl fmt::Display for ParseEtherTypeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ParseEtherTypeError::InvalidLength => {
write!(f, "expected a 4-digit hexadecimal string")
}
ParseEtherTypeError::ParseInt(err) => write!(f, "{}", err),
}
}
}
#[cfg(feature = "std")]
mod std {
use std::error::Error;
use super::ParseEtherTypeError;
impl Error for ParseEtherTypeError {}
}