stores: Switch from dyn to impl and implement Sized

This commit is contained in:
Lennart
2025-01-15 17:21:01 +01:00
parent 751c2d1ce7
commit 6d78a3936f
28 changed files with 55 additions and 72 deletions

View File

@@ -8,7 +8,7 @@ use derive_more::derive::Constructor;
use sha2::{Digest, Sha256};
#[derive(Constructor, Clone)]
pub struct ContactBirthdayStore<AS: AddressbookStore + ?Sized>(Arc<AS>);
pub struct ContactBirthdayStore<AS: AddressbookStore>(Arc<AS>);
fn birthday_calendar(addressbook: Addressbook) -> Calendar {
Calendar {
@@ -35,7 +35,7 @@ fn birthday_calendar(addressbook: Addressbook) -> Calendar {
}
#[async_trait]
impl<AS: AddressbookStore + ?Sized> CalendarStore for ContactBirthdayStore<AS> {
impl<AS: AddressbookStore> CalendarStore for ContactBirthdayStore<AS> {
async fn get_calendar(&self, principal: &str, id: &str) -> Result<Calendar, Error> {
let addressbook = self.0.get_addressbook(principal, id).await?;
Ok(birthday_calendar(addressbook))