From 9f5c13625e223b2c1d695c638bc8e064d0134e41 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 27 Feb 2023 16:03:09 +0100 Subject: [PATCH 1/2] Make trait bound more specific --- crates/fj-kernel/src/services/service.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/services/service.rs b/crates/fj-kernel/src/services/service.rs index 5ce2a50d9..d77d4bd8d 100644 --- a/crates/fj-kernel/src/services/service.rs +++ b/crates/fj-kernel/src/services/service.rs @@ -100,7 +100,10 @@ where } } -impl Subscriber for Service { +impl Subscriber for Service +where + S::Command: Clone, +{ fn handle_event(&mut self, event: &S::Command) { self.execute(event.clone()); } @@ -113,7 +116,7 @@ pub trait State { /// A command that relates to the state /// /// Commands are processed by [`State::decide`]. - type Command: Clone; + type Command; /// An event that captures modifications to this state /// From c69f8e904b8f158759018fca6557d318c4e1d0ef Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 27 Feb 2023 16:03:41 +0100 Subject: [PATCH 2/2] Remove unused trait bound --- crates/fj-kernel/src/services/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/services/service.rs b/crates/fj-kernel/src/services/service.rs index d77d4bd8d..b03e6f09f 100644 --- a/crates/fj-kernel/src/services/service.rs +++ b/crates/fj-kernel/src/services/service.rs @@ -122,7 +122,7 @@ pub trait State { /// /// Events are produced by [`State::decide`] and processed by /// [`State::evolve`]. - type Event: Clone; + type Event; /// Decide how to react to the provided command ///