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

@@ -39,7 +39,7 @@ struct UserPage {
pub deleted_addressbooks: Vec<Addressbook>,
}
async fn route_user<CS: CalendarStore + ?Sized, AS: AddressbookStore + ?Sized>(
async fn route_user<CS: CalendarStore, AS: AddressbookStore>(
path: Path<String>,
cal_store: Data<CS>,
addr_store: Data<AS>,
@@ -99,11 +99,7 @@ fn unauthorized_handler<B>(res: ServiceResponse<B>) -> actix_web::Result<ErrorHa
Ok(ErrorHandlerResponse::Response(res))
}
pub fn configure_frontend<
AP: AuthenticationProvider,
CS: CalendarStore + ?Sized,
AS: AddressbookStore + ?Sized,
>(
pub fn configure_frontend<AP: AuthenticationProvider, CS: CalendarStore, AS: AddressbookStore>(
cfg: &mut web::ServiceConfig,
auth_provider: Arc<AP>,
cal_store: Arc<CS>,

View File

@@ -12,7 +12,7 @@ struct AddressbookPage {
addressbook: Addressbook,
}
pub async fn route_addressbook<AS: AddressbookStore + ?Sized>(
pub async fn route_addressbook<AS: AddressbookStore>(
path: Path<(String, String)>,
store: Data<AS>,
_user: User,
@@ -23,7 +23,7 @@ pub async fn route_addressbook<AS: AddressbookStore + ?Sized>(
})
}
pub async fn route_addressbook_restore<AS: AddressbookStore + ?Sized>(
pub async fn route_addressbook_restore<AS: AddressbookStore>(
path: Path<(String, String)>,
req: HttpRequest,
store: Data<AS>,

View File

@@ -12,7 +12,7 @@ struct CalendarPage {
calendar: Calendar,
}
pub async fn route_calendar<C: CalendarStore + ?Sized>(
pub async fn route_calendar<C: CalendarStore>(
path: Path<(String, String)>,
store: Data<C>,
_user: User,
@@ -23,7 +23,7 @@ pub async fn route_calendar<C: CalendarStore + ?Sized>(
})
}
pub async fn route_calendar_restore<CS: CalendarStore + ?Sized>(
pub async fn route_calendar_restore<CS: CalendarStore>(
path: Path<(String, String)>,
req: HttpRequest,
store: Data<CS>,