diff --git a/crates/caldav/src/calendar/methods/report/mod.rs b/crates/caldav/src/calendar/methods/report/mod.rs index b6cc358..afab285 100644 --- a/crates/caldav/src/calendar/methods/report/mod.rs +++ b/crates/caldav/src/calendar/methods/report/mod.rs @@ -104,11 +104,7 @@ mod tests { assert_eq!( report_request, ReportRequest::CalendarQuery(CalendarQueryRequest { - prop: PropfindType::Prop(PropElement { - prop: vec![Propname { - name: "getetag".to_owned() - }] - }), + prop: PropfindType::Prop(PropElement(vec![Propname("getetag".to_owned())])), filter: Some(FilterElement { comp_filter: CompFilterElement { is_not_defined: None, diff --git a/crates/carddav/src/addressbook/methods/report/mod.rs b/crates/carddav/src/addressbook/methods/report/mod.rs index 4617619..6bd1a98 100644 --- a/crates/carddav/src/addressbook/methods/report/mod.rs +++ b/crates/carddav/src/addressbook/methods/report/mod.rs @@ -85,11 +85,9 @@ mod tests { ReportRequest::SyncCollection(SyncCollectionRequest { sync_token: "".to_owned(), sync_level: SyncLevel::One, - prop: rustical_dav::xml::PropfindType::Prop(PropElement { - prop: vec![Propname { - name: "getetag".to_owned() - }] - }), + prop: rustical_dav::xml::PropfindType::Prop(PropElement(vec![Propname( + "getetag".to_owned() + )])), limit: None }) ) diff --git a/crates/dav/src/xml/propfind.rs b/crates/dav/src/xml/propfind.rs index d4f3d9c..a1d3579 100644 --- a/crates/dav/src/xml/propfind.rs +++ b/crates/dav/src/xml/propfind.rs @@ -16,7 +16,10 @@ pub struct Propname(#[xml(ty = "tag_name")] pub String); #[derive(Debug, Clone, XmlDeserialize, PartialEq)] pub enum PropfindType { + #[xml(ns = "crate::namespace::NS_DAV")] Propname, + #[xml(ns = "crate::namespace::NS_DAV")] Allprop, + #[xml(ns = "crate::namespace::NS_DAV")] Prop(PropElement), } diff --git a/crates/dav/tests/propfind.rs b/crates/dav/tests/propfind.rs index 7479858..02b6e16 100644 --- a/crates/dav/tests/propfind.rs +++ b/crates/dav/tests/propfind.rs @@ -53,16 +53,10 @@ fn propfind_prop() { assert_eq!( propfind, PropfindElement { - prop: PropfindType::Prop(PropElement { - prop: vec![ - Propname { - name: "displayname".to_owned() - }, - Propname { - name: "color".to_owned() - }, - ] - }) + prop: PropfindType::Prop(PropElement(vec![ + Propname("displayname".to_owned()), + Propname("color".to_owned()), + ])) } ); }