ResourceName trait: Use Cow instead of String

This commit is contained in:
Lennart
2025-12-31 10:57:12 +01:00
parent 9c3972e21c
commit 578ddde36d
7 changed files with 23 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
use std::borrow::Cow;
use crate::Error;
use rustical_dav::extensions::CommonPropertiesExtension;
use rustical_dav::privileges::UserPrivilegeSet;
@@ -21,8 +23,8 @@ pub struct PrincipalResource {
}
impl ResourceName for PrincipalResource {
fn get_name(&self) -> String {
self.principal.id.clone()
fn get_name(&self) -> Cow<'_, str> {
Cow::from(&self.principal.id)
}
}