hard_xml/
xml_extended_error.rs1#[derive(Debug)]
7#[non_exhaustive]
8pub enum XmlExtendedError {
9 DuplicateAttribute(std::borrow::Cow<'static, str>),
10 DuplicateElement(std::borrow::Cow<'static, str>),
11}
12
13impl std::error::Error for XmlExtendedError {}
14
15impl std::fmt::Display for XmlExtendedError {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 match self {
18 XmlExtendedError::DuplicateAttribute(attr) => write!(f, "Duplicate attribute {:?}", attr),
19 XmlExtendedError::DuplicateElement(name) => write!(f, "Duplicate element <{}>", name),
20 }
21 }
22}