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

@@ -78,10 +78,9 @@ pub async fn handle_calendar_multiget<C: CalendarStore + ?Sized>(
PropfindType::Propname => {
vec!["propname".to_owned()]
}
PropfindType::Prop(PropElement { prop: prop_tags }) => prop_tags
.into_iter()
.map(|propname| propname.name)
.collect(),
PropfindType::Prop(PropElement(prop_tags)) => {
prop_tags.into_iter().map(|propname| propname.0).collect()
}
};
let props: Vec<&str> = props.iter().map(String::as_str).collect();

View File

@@ -207,10 +207,9 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
PropfindType::Propname => {
vec!["propname".to_owned()]
}
PropfindType::Prop(PropElement { prop: prop_tags }) => prop_tags
.into_iter()
.map(|propname| propname.name)
.collect(),
PropfindType::Prop(PropElement(prop_tags)) => {
prop_tags.into_iter().map(|propname| propname.0).collect()
}
};
let props: Vec<&str> = props.iter().map(String::as_str).collect();

View File

@@ -73,10 +73,9 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
PropfindType::Propname => {
vec!["propname".to_owned()]
}
PropfindType::Prop(PropElement { prop: prop_tags }) => prop_tags
.into_iter()
.map(|propname| propname.name)
.collect(),
PropfindType::Prop(PropElement(prop_tags)) => {
prop_tags.into_iter().map(|propname| propname.0).collect()
}
};
let props: Vec<&str> = props.iter().map(String::as_str).collect();

View File

@@ -100,25 +100,13 @@ impl Resource for CalendarResource {
fn get_resourcetype(&self) -> Resourcetype {
if self.0.subscription_url.is_none() {
Resourcetype(&[
ResourcetypeInner {
ns: rustical_dav::namespace::NS_DAV,
name: "collection",
},
ResourcetypeInner {
ns: rustical_dav::namespace::NS_CALDAV,
name: "calendar",
},
ResourcetypeInner(rustical_dav::namespace::NS_DAV, "collection"),
ResourcetypeInner(rustical_dav::namespace::NS_CALDAV, "calendar"),
])
} else {
Resourcetype(&[
ResourcetypeInner {
ns: rustical_dav::namespace::NS_DAV,
name: "collection",
},
ResourcetypeInner {
ns: rustical_dav::namespace::NS_CALENDARSERVER,
name: "subscribed",
},
ResourcetypeInner(rustical_dav::namespace::NS_DAV, "collection"),
ResourcetypeInner(rustical_dav::namespace::NS_CALENDARSERVER, "subscribed"),
])
}
}