From 11469642be6b7c0bc78e55a2941c5d1773247820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Wed, 5 Nov 2025 15:50:05 +0100 Subject: [PATCH] Use an associated type rather than a generic for IntoActorHandle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- crates/tytix-core/src/actor.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/tytix-core/src/actor.rs b/crates/tytix-core/src/actor.rs index 45fad5c..4cd968a 100644 --- a/crates/tytix-core/src/actor.rs +++ b/crates/tytix-core/src/actor.rs @@ -14,12 +14,15 @@ where type HandledMessages: MessageBundle; } -pub trait IntoActorHandle { - fn into_actor_handle(self) -> ActorHandle; +pub trait IntoActorHandle { + type HandledMessages: MessageBundle; + fn into_actor_handle(self) -> ActorHandle; } -impl IntoActorHandle for A { - fn into_actor_handle(self) -> ActorHandle { +impl IntoActorHandle for A { + type HandledMessages = A::HandledMessages; + + fn into_actor_handle(self) -> ActorHandle { ActorHandle::new(self) } }