minor refactoring

This commit is contained in:
Lennart
2024-07-28 21:03:02 +02:00
parent 6ac2948617
commit f497698589
6 changed files with 22 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
use crate::xml::TagList;
use crate::{namespace::Namespace, xml::TagList};
use actix_web::{
body::BoxBody, http::header::ContentType, HttpRequest, HttpResponse, Responder, ResponseError,
};
@@ -56,6 +56,18 @@ pub struct MultistatusElement<T1: Serialize, T2: Serialize> {
pub ns_ical: &'static str,
}
impl<T1: Serialize, T2: Serialize> Default for MultistatusElement<T1, T2> {
fn default() -> Self {
Self {
responses: vec![],
member_responses: vec![],
ns_dav: Namespace::Dav.as_str(),
ns_caldav: Namespace::CalDAV.as_str(),
ns_ical: Namespace::ICal.as_str(),
}
}
}
impl<T1: Serialize, T2: Serialize> Responder for MultistatusElement<T1, T2> {
type Body = BoxBody;