mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 15:52:27 +00:00
xml use tuple structs
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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"),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,14 +59,8 @@ impl Resource for PrincipalResource {
|
||||
|
||||
fn get_resourcetype(&self) -> Resourcetype {
|
||||
Resourcetype(&[
|
||||
ResourcetypeInner {
|
||||
ns: rustical_dav::namespace::NS_DAV,
|
||||
name: "collection",
|
||||
},
|
||||
ResourcetypeInner {
|
||||
ns: rustical_dav::namespace::NS_DAV,
|
||||
name: "principal",
|
||||
},
|
||||
ResourcetypeInner(rustical_dav::namespace::NS_DAV, "collection"),
|
||||
ResourcetypeInner(rustical_dav::namespace::NS_DAV, "principal"),
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user