xml: new variant flag and fixes to generic types

This commit is contained in:
Lennart
2024-12-25 10:21:09 +01:00
parent 92b7be5591
commit 5e2717e130
8 changed files with 194 additions and 82 deletions

View File

@@ -10,8 +10,6 @@ use thiserror::Error;
#[derive(Debug, Error)]
pub enum XmlDeError {
#[error(transparent)]
QuickXmlDeError(#[from] quick_xml::de::DeError),
#[error(transparent)]
QuickXmlError(#[from] quick_xml::Error),
#[error(transparent)]

View File

@@ -20,21 +20,6 @@ pub trait Value: Sized {
fn deserialize(val: &str) -> Result<Self, XmlDeError>;
}
// impl<T: Value> Value for Option<T> {
// fn serialize(&self) -> String {
// match self {
// Some(inner) => inner.serialize(),
// None => "".to_owned(),
// }
// }
// fn deserialize(val: &str) -> Result<Self, XmlDeError> {
// match val {
// "" => Ok(None),
// val => Ok(Some(T::deserialize(val)?)),
// }
// }
// }
macro_rules! impl_value_parse {
($t:ty) => {
impl Value for $t {