fix some dumb design decisions

This commit is contained in:
Lennart
2024-11-04 17:57:09 +01:00
parent 0fed7b05fa
commit c41e3e3abb
9 changed files with 17 additions and 72 deletions

View File

@@ -6,9 +6,7 @@ use actix_web::HttpRequest;
use async_trait::async_trait;
use derive_more::derive::{From, TryInto};
use rustical_dav::extension::BoxedExtension;
use rustical_dav::extensions::{
CommonPropertiesExtension, CommonPropertiesProp, CommonPropertiesPropName,
};
use rustical_dav::extensions::{CommonPropertiesExtension, CommonPropertiesProp};
use rustical_dav::privileges::UserPrivilegeSet;
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
use rustical_dav::xml::HrefElement;
@@ -63,17 +61,13 @@ impl InvalidProperty for PrincipalProp {
}
}
#[derive(EnumString, VariantNames, Clone, From, TryInto)]
#[derive(EnumString, VariantNames, Clone)]
#[strum(serialize_all = "kebab-case")]
pub enum PrincipalPropName {
#[strum(serialize = "principal-URL")]
PrincipalUrl,
CalendarHomeSet,
CalendarUserAddressSet,
#[from]
#[try_into]
#[strum(disabled)]
ExtCommonProperties(CommonPropertiesPropName),
}
impl PrincipalResource {
@@ -108,7 +102,6 @@ impl Resource for PrincipalResource {
PrincipalPropName::CalendarUserAddressSet => {
PrincipalProp::CalendarUserAddressSet(principal_href)
}
_ => panic!("we shouldn't end up here"),
})
}