Skip to content

Commit

Permalink
Merge pull request #1629 from hannobraun/service
Browse files Browse the repository at this point in the history
Make some tweaks in service code
  • Loading branch information
hannobraun authored Feb 27, 2023
2 parents 89d489f + c69f8e9 commit 9056c49
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/fj-kernel/src/services/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ where
}
}

impl<S: State> Subscriber<S::Command> for Service<S> {
impl<S: State> Subscriber<S::Command> for Service<S>
where
S::Command: Clone,
{
fn handle_event(&mut self, event: &S::Command) {
self.execute(event.clone());
}
Expand All @@ -113,13 +116,13 @@ 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
///
/// Events are produced by [`State::decide`] and processed by
/// [`State::evolve`].
type Event: Clone;
type Event;

/// Decide how to react to the provided command
///
Expand Down

0 comments on commit 9056c49

Please sign in to comment.