use core::fmt;
use std::error::Error;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum ParseError {
InvalidLength,
}
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match self {
ParseError::InvalidLength => {
write!(f, "The input string length is too large to fit in a `u32`")
}
}
}
}
impl Error for ParseError {}
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub enum SetBytesError {
LengthOverflow,
}
impl fmt::Display for SetBytesError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match self {
SetBytesError::LengthOverflow => {
write!(f, "The string length is too large to fit in a `u32`")
}
}
}
}
impl Error for SetBytesError {}