dav: for propfind replace HashSet with Vec to make output deterministic

This commit is contained in:
Lennart
2025-07-29 15:49:58 +02:00
parent 0159a8d9c9
commit 90c38e7703

View File

@@ -11,7 +11,6 @@ pub use resource_service::ResourceService;
use rustical_xml::{ use rustical_xml::{
EnumVariants, NamespaceOwned, PropName, XmlDeserialize, XmlDocument, XmlSerialize, EnumVariants, NamespaceOwned, PropName, XmlDeserialize, XmlDocument, XmlSerialize,
}; };
use std::collections::HashSet;
use std::str::FromStr; use std::str::FromStr;
mod axum_methods; mod axum_methods;
@@ -131,7 +130,7 @@ pub trait Resource: Clone + Send + 'static {
path.push('/'); path.push('/');
} }
let (mut props, mut invalid_props): (HashSet<<Self::Prop as PropName>::Names>, Vec<_>) = let (mut props, mut invalid_props): (Vec<<Self::Prop as PropName>::Names>, Vec<_>) =
match prop { match prop {
PropfindType::Propname => { PropfindType::Propname => {
let props = Self::list_props() let props = Self::list_props()
@@ -156,7 +155,7 @@ pub trait Resource: Clone + Send + 'static {
vec![], vec![],
), ),
PropfindType::Prop(PropElement(valid_tags, invalid_tags)) => ( PropfindType::Prop(PropElement(valid_tags, invalid_tags)) => (
valid_tags.iter().cloned().collect(), valid_tags.iter().unique().cloned().collect(),
invalid_tags.to_owned(), invalid_tags.to_owned(),
), ),
}; };