language_code/
error.rs

1use core::fmt;
2
3//
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum ParseError {
6    Invalid(::alloc::boxed::Box<str>),
7}
8
9impl fmt::Display for ParseError {
10    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11        write!(f, "{self:?}")
12    }
13}
14
15#[cfg(feature = "std")]
16impl std::error::Error for ParseError {}
17
18//
19#[derive(Debug, Clone, PartialEq, Eq)]
20pub enum LanguageTagParseError {
21    LanguageCodeInvalid(::alloc::boxed::Box<str>),
22    CountryCodeInvalid(::alloc::boxed::Box<str>),
23}
24
25impl fmt::Display for LanguageTagParseError {
26    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27        write!(f, "{self:?}")
28    }
29}
30
31#[cfg(feature = "std")]
32impl std::error::Error for LanguageTagParseError {}