mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 15:12:23 +00:00
stores: Switch from dyn to impl and implement Sized
This commit is contained in:
@@ -12,7 +12,7 @@ use tracing_actix_web::RootSpan;
|
||||
use super::resource::CalendarObjectPathComponents;
|
||||
|
||||
#[instrument(parent = root_span.id(), skip(store, root_span))]
|
||||
pub async fn get_event<C: CalendarStore + ?Sized>(
|
||||
pub async fn get_event<C: CalendarStore>(
|
||||
path: Path<CalendarObjectPathComponents>,
|
||||
store: Data<C>,
|
||||
user: User,
|
||||
@@ -42,7 +42,7 @@ pub async fn get_event<C: CalendarStore + ?Sized>(
|
||||
}
|
||||
|
||||
#[instrument(parent = root_span.id(), skip(store, req, root_span))]
|
||||
pub async fn put_event<C: CalendarStore + ?Sized>(
|
||||
pub async fn put_event<C: CalendarStore>(
|
||||
path: Path<CalendarObjectPathComponents>,
|
||||
store: Data<C>,
|
||||
body: String,
|
||||
|
||||
@@ -14,11 +14,11 @@ use serde::Deserialize;
|
||||
use std::sync::Arc;
|
||||
use strum::{EnumDiscriminants, EnumString, IntoStaticStr, VariantNames};
|
||||
|
||||
pub struct CalendarObjectResourceService<C: CalendarStore + ?Sized> {
|
||||
pub struct CalendarObjectResourceService<C: CalendarStore> {
|
||||
cal_store: Arc<C>,
|
||||
}
|
||||
|
||||
impl<C: CalendarStore + ?Sized> CalendarObjectResourceService<C> {
|
||||
impl<C: CalendarStore> CalendarObjectResourceService<C> {
|
||||
pub fn new(cal_store: Arc<C>) -> Self {
|
||||
Self { cal_store }
|
||||
}
|
||||
@@ -110,7 +110,7 @@ impl<'de> Deserialize<'de> for CalendarObjectPathComponents {
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
impl<C: CalendarStore + ?Sized> ResourceService for CalendarObjectResourceService<C> {
|
||||
impl<C: CalendarStore> ResourceService for CalendarObjectResourceService<C> {
|
||||
type PathComponents = CalendarObjectPathComponents;
|
||||
type Resource = CalendarObjectResource;
|
||||
type MemberType = CalendarObjectResource;
|
||||
|
||||
Reference in New Issue
Block a user