mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
propfind: Use HashSet to prevent duplicate prop
This commit is contained in:
@@ -9,6 +9,7 @@ use itertools::Itertools;
|
|||||||
use quick_xml::name::Namespace;
|
use quick_xml::name::Namespace;
|
||||||
pub use resource_service::ResourceService;
|
pub use resource_service::ResourceService;
|
||||||
use rustical_xml::{EnumUnitVariants, EnumVariants, XmlDeserialize, XmlSerialize};
|
use rustical_xml::{EnumUnitVariants, EnumVariants, XmlDeserialize, XmlSerialize};
|
||||||
|
use std::collections::HashSet;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
mod methods;
|
mod methods;
|
||||||
@@ -105,7 +106,7 @@ pub trait Resource: Clone + 'static {
|
|||||||
principal_uri: &impl PrincipalUri,
|
principal_uri: &impl PrincipalUri,
|
||||||
principal: &Self::Principal,
|
principal: &Self::Principal,
|
||||||
) -> Result<ResponseElement<Self::Prop>, Self::Error> {
|
) -> Result<ResponseElement<Self::Prop>, Self::Error> {
|
||||||
let mut props = props.to_vec();
|
let mut props: HashSet<&str> = props.iter().cloned().collect();
|
||||||
|
|
||||||
if props.contains(&"propname") {
|
if props.contains(&"propname") {
|
||||||
if props.len() != 1 {
|
if props.len() != 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user