From 8222147bfd475b49740aae57f16414d663a603cd Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 15 Feb 2024 12:36:48 +0100 Subject: [PATCH] Return `Command::Result` from `Layer::process` --- crates/fj-core/src/layers/layer.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/fj-core/src/layers/layer.rs b/crates/fj-core/src/layers/layer.rs index 71bf360c3..140f1049b 100644 --- a/crates/fj-core/src/layers/layer.rs +++ b/crates/fj-core/src/layers/layer.rs @@ -27,15 +27,21 @@ impl Layer { /// /// The command is processed synchronously. When this method returns, the /// state has been updated. - pub fn process(&mut self, command: C, events: &mut Vec) + pub fn process( + &mut self, + command: C, + events: &mut Vec, + ) -> C::Result where C: Command, { - command.decide(&self.state, events); + let result = command.decide(&self.state, events); for event in events { event.evolve(&mut self.state); } + + result } /// Drop this instance, returning the wrapped state