Formatting

This commit is contained in:
Lennart
2024-07-28 17:47:49 +02:00
parent 21fe841ef1
commit ea460f8187
4 changed files with 19 additions and 24 deletions

View File

@@ -76,6 +76,7 @@ pub async fn route_mkcalendar<A: CheckAuthentication, C: CalendarStore + ?Sized>
color: request.calendar_color,
description: request.calendar_description,
deleted_at: None,
synctoken: 0,
};
match context

View File

@@ -55,15 +55,13 @@ impl Resource for EventFile {
type Error = Error;
fn get_prop(&self, _prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
match prop {
EventPropName::Getetag => Ok(EventProp::Getetag(self.event.get_etag())),
EventPropName::CalendarData => {
Ok(EventProp::CalendarData(self.event.get_ics().to_owned()))
Ok(match prop {
EventPropName::Getetag => EventProp::Getetag(self.event.get_etag()),
EventPropName::CalendarData => EventProp::CalendarData(self.event.get_ics().to_owned()),
EventPropName::Getcontenttype => {
EventProp::Getcontenttype("text/calendar;charset=utf-8".to_owned())
}
EventPropName::Getcontenttype => Ok(EventProp::Getcontenttype(
"text/calendar;charset=utf-8".to_owned(),
)),
}
})
}
}

View File

@@ -72,21 +72,17 @@ impl Resource for PrincipalFile {
fn get_prop(&self, prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
let principal_href = HrefElement::new(format!("{}/user/{}/", prefix, self.principal));
match prop {
PrincipalPropName::Resourcetype => {
Ok(PrincipalProp::Resourcetype(Resourcetype::default()))
}
Ok(match prop {
PrincipalPropName::Resourcetype => PrincipalProp::Resourcetype(Resourcetype::default()),
PrincipalPropName::CurrentUserPrincipal => {
Ok(PrincipalProp::CurrentUserPrincipal(principal_href))
}
PrincipalPropName::PrincipalUrl => Ok(PrincipalProp::PrincipalUrl(principal_href)),
PrincipalPropName::CalendarHomeSet => {
Ok(PrincipalProp::CalendarHomeSet(principal_href))
PrincipalProp::CurrentUserPrincipal(principal_href)
}
PrincipalPropName::PrincipalUrl => PrincipalProp::PrincipalUrl(principal_href),
PrincipalPropName::CalendarHomeSet => PrincipalProp::CalendarHomeSet(principal_href),
PrincipalPropName::CalendarUserAddressSet => {
Ok(PrincipalProp::CalendarUserAddressSet(principal_href))
PrincipalProp::CalendarUserAddressSet(principal_href)
}
}
})
}
}

View File

@@ -51,12 +51,12 @@ impl Resource for RootFile {
type Error = Error;
fn get_prop(&self, prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
match prop {
RootPropName::Resourcetype => Ok(RootProp::Resourcetype(Resourcetype::default())),
RootPropName::CurrentUserPrincipal => Ok(RootProp::CurrentUserPrincipal(
HrefElement::new(format!("{}/user/{}/", prefix, self.principal)),
Ok(match prop {
RootPropName::Resourcetype => RootProp::Resourcetype(Resourcetype::default()),
RootPropName::CurrentUserPrincipal => RootProp::CurrentUserPrincipal(HrefElement::new(
format!("{}/user/{}/", prefix, self.principal),
)),
}
})
}
}