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::{
http::{header::ContentType, StatusCode},
web::Data,
@@ -10,15 +18,6 @@ use quick_xml::{
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
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.
pub async fn generate_propfind_root_response(
props: Vec<&str>,
@@ -46,10 +45,9 @@ pub async fn generate_propfind_root_response(
.write_inner_content(|writer| {
writer
.create_element("href")
.write_text_content(BytesText::new(
// TODO: Replace hard-coded string
&format!("{prefix}/{principal}"),
))?;
.write_text_content(BytesText::new(&format!(
"{prefix}/{principal}"
)))?;
Ok(())
})?;
}