intense code jankification

This commit is contained in:
Lennart
2024-03-14 19:46:32 +01:00
parent b540362791
commit b21586d077
4 changed files with 32 additions and 15 deletions

View File

@@ -132,10 +132,11 @@ pub enum CalendarProp {
}
#[derive(Serialize)]
#[serde(untagged)]
#[serde(rename_all = "kebab-case")]
pub enum CalendarPropResponse {
Resourcetype(Resourcetype),
CurrentUser(HrefElement),
CurrentUserPrincipal(HrefElement),
Owner(HrefElement),
Displayname(TextNode),
CalendarColor(TextNode),
CalendarDescription(TextNode),
@@ -190,11 +191,13 @@ impl<C: CalendarStore + ?Sized> Resource for CalendarResource<C> {
CalendarProp::Resourcetype => {
Ok(CalendarPropResponse::Resourcetype(Resourcetype::default()))
}
CalendarProp::CurrentUserPrincipal | CalendarProp::Owner => {
Ok(CalendarPropResponse::CurrentUser(HrefElement::new(
format!("{}/{}/", self.prefix, self.principal),
)))
}
CalendarProp::CurrentUserPrincipal => Ok(CalendarPropResponse::CurrentUserPrincipal(
HrefElement::new(format!("{}/{}/", self.prefix, self.principal)),
)),
CalendarProp::Owner => Ok(CalendarPropResponse::Owner(HrefElement::new(format!(
"{}/{}/",
self.prefix, self.principal
)))),
CalendarProp::Displayname => Ok(CalendarPropResponse::Displayname(TextNode(
self.calendar.name.clone(),
))),