use core::fmt;
#[derive(Copy, Debug, PartialEq, Eq, Clone)]
pub enum ParseMacAddrError {
TooManyComponents,
TooFewComponents,
InvalidComponent,
}
impl fmt::Display for ParseMacAddrError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let s = match *self {
ParseMacAddrError::TooManyComponents => "Too many components in a MAC address string",
ParseMacAddrError::TooFewComponents => "Too few components in a MAC address string",
ParseMacAddrError::InvalidComponent => "Invalid component in a MAC address string",
};
f.write_str(s)
}
}
#[cfg(feature = "std")]
impl std::error::Error for ParseMacAddrError {}