mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
stores: Switch from dyn to impl and implement Sized
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user