From 6750ebb832aebd65c97065aeea876e913dd89cbe Mon Sep 17 00:00:00 2001 From: tyranron Date: Fri, 3 Sep 2021 13:02:36 +0300 Subject: [PATCH] Lift redundant Sized requirements on event::Sourcing blanket impls (#5, #1) --- core/src/es/event.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/es/event.rs b/core/src/es/event.rs index 5695bf5..92bb88d 100644 --- a/core/src/es/event.rs +++ b/core/src/es/event.rs @@ -161,28 +161,25 @@ pub trait Sourcing { fn apply_to(&self, state: &mut S); } -impl Sourcing for Ev -where - S: Sourced, -{ +impl + ?Sized> Sourcing for Ev { fn apply_to(&self, state: &mut S) { state.apply(self); } } -impl<'e, S> Sourced + 'e> for S { +impl<'e, S: ?Sized> Sourced + 'e> for S { fn apply(&mut self, event: &(dyn Sourcing + 'e)) { event.apply_to(self); } } -impl<'e, S> Sourced + Send + 'e> for S { +impl<'e, S: ?Sized> Sourced + Send + 'e> for S { fn apply(&mut self, event: &(dyn Sourcing + Send + 'e)) { event.apply_to(self); } } -impl<'e, S> Sourced + Send + Sync + 'e> for S { +impl<'e, S: ?Sized> Sourced + Send + Sync + 'e> for S { fn apply(&mut self, event: &(dyn Sourcing + Send + Sync + 'e)) { event.apply_to(self); }