use core::fmt;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ParseLiteralError {
UnexpectedEnd,
UnexpectedCharacter(char),
}
impl fmt::Display for ParseLiteralError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::UnexpectedEnd => write!(f, "Unexpected end of JSON literal!"),
Self::UnexpectedCharacter(c) => write!(f, "Invalid character ({c}) in JSON literal!"),
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for ParseLiteralError {}