mild refactoring

This commit is contained in:
Lennart
2023-09-07 19:19:57 +02:00
parent 04524a295e
commit 407a85dc39

View File

@@ -1,3 +1,11 @@
use crate::{
namespace::Namespace,
propfind::{
generate_multistatus, parse_propfind, write_invalid_props_response,
write_propstat_response, write_resourcetype,
},
CalDavContext, Error,
};
use actix_web::{ use actix_web::{
http::{header::ContentType, StatusCode}, http::{header::ContentType, StatusCode},
web::Data, web::Data,
@@ -10,15 +18,6 @@ use quick_xml::{
use rustical_auth::{AuthInfoExtractor, CheckAuthentication}; use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
use rustical_store::calendar::CalendarStore; use rustical_store::calendar::CalendarStore;
use crate::{
namespace::Namespace,
propfind::{
generate_multistatus, parse_propfind, write_invalid_props_response,
write_propstat_response, write_resourcetype,
},
CalDavContext, Error,
};
// Executes the PROPFIND request and returns a XML string to be written into a <mulstistatus> object. // Executes the PROPFIND request and returns a XML string to be written into a <mulstistatus> object.
pub async fn generate_propfind_root_response( pub async fn generate_propfind_root_response(
props: Vec<&str>, props: Vec<&str>,
@@ -46,10 +45,9 @@ pub async fn generate_propfind_root_response(
.write_inner_content(|writer| { .write_inner_content(|writer| {
writer writer
.create_element("href") .create_element("href")
.write_text_content(BytesText::new( .write_text_content(BytesText::new(&format!(
// TODO: Replace hard-coded string "{prefix}/{principal}"
&format!("{prefix}/{principal}"), )))?;
))?;
Ok(()) Ok(())
})?; })?;
} }