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

@@ -11,13 +11,14 @@ use rustical_dav::xml::{Resourcetype, ResourcetypeInner, SupportedReportSet};
use rustical_dav_push::DavPushExtension;
use rustical_store::Addressbook;
use rustical_store::auth::Principal;
use std::borrow::Cow;
#[derive(Clone, Debug, From, Into)]
pub struct AddressbookResource(pub(crate) Addressbook);
impl ResourceName for AddressbookResource {
fn get_name(&self) -> String {
self.0.id.clone()
fn get_name(&self) -> Cow<'_, str> {
Cow::from(&self.0.id)
}
}