xml use tuple structs

This commit is contained in:
Lennart
2025-01-05 17:06:15 +01:00
parent 2eb6b1934d
commit 9ea9beb143
17 changed files with 57 additions and 141 deletions

View File

@@ -4,21 +4,15 @@ use rustical_xml::XmlRootTag;
#[derive(Debug, Clone, XmlDeserialize, XmlRootTag, PartialEq)]
#[xml(root = b"propfind", ns = "crate::namespace::NS_DAV")]
pub struct PropfindElement {
#[xml(ty = "untagged")]
#[xml(ns = "crate::namespace::NS_DAV")]
pub prop: PropfindType,
}
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
pub struct PropElement {
#[xml(ty = "untagged", flatten)]
pub prop: Vec<Propname>,
}
pub struct PropElement(#[xml(ty = "untagged", flatten)] pub Vec<Propname>);
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
pub struct Propname {
#[xml(ty = "tag_name")]
pub name: String,
}
pub struct Propname(#[xml(ty = "tag_name")] pub String);
#[derive(Debug, Clone, XmlDeserialize, PartialEq)]
pub enum PropfindType {