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, color: request.calendar_color,
description: request.calendar_description, description: request.calendar_description,
deleted_at: None, deleted_at: None,
synctoken: 0,
}; };
match context match context

View File

@@ -55,15 +55,13 @@ impl Resource for EventFile {
type Error = Error; type Error = Error;
fn get_prop(&self, _prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> { fn get_prop(&self, _prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
match prop { Ok(match prop {
EventPropName::Getetag => Ok(EventProp::Getetag(self.event.get_etag())), EventPropName::Getetag => EventProp::Getetag(self.event.get_etag()),
EventPropName::CalendarData => { EventPropName::CalendarData => EventProp::CalendarData(self.event.get_ics().to_owned()),
Ok(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> { fn get_prop(&self, prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
let principal_href = HrefElement::new(format!("{}/user/{}/", prefix, self.principal)); let principal_href = HrefElement::new(format!("{}/user/{}/", prefix, self.principal));
match prop { Ok(match prop {
PrincipalPropName::Resourcetype => { PrincipalPropName::Resourcetype => PrincipalProp::Resourcetype(Resourcetype::default()),
Ok(PrincipalProp::Resourcetype(Resourcetype::default()))
}
PrincipalPropName::CurrentUserPrincipal => { PrincipalPropName::CurrentUserPrincipal => {
Ok(PrincipalProp::CurrentUserPrincipal(principal_href)) PrincipalProp::CurrentUserPrincipal(principal_href)
}
PrincipalPropName::PrincipalUrl => Ok(PrincipalProp::PrincipalUrl(principal_href)),
PrincipalPropName::CalendarHomeSet => {
Ok(PrincipalProp::CalendarHomeSet(principal_href))
} }
PrincipalPropName::PrincipalUrl => PrincipalProp::PrincipalUrl(principal_href),
PrincipalPropName::CalendarHomeSet => PrincipalProp::CalendarHomeSet(principal_href),
PrincipalPropName::CalendarUserAddressSet => { PrincipalPropName::CalendarUserAddressSet => {
Ok(PrincipalProp::CalendarUserAddressSet(principal_href)) PrincipalProp::CalendarUserAddressSet(principal_href)
} }
} })
} }
} }

View File

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