Use an associated type rather than a generic for IntoActorHandle

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2025-11-05 15:50:05 +01:00
parent 29a127a62b
commit 11469642be

View file

@ -14,12 +14,15 @@ where
type HandledMessages: MessageBundle; type HandledMessages: MessageBundle;
} }
pub trait IntoActorHandle<MB> { pub trait IntoActorHandle {
fn into_actor_handle(self) -> ActorHandle<MB>; type HandledMessages: MessageBundle;
fn into_actor_handle(self) -> ActorHandle<Self::HandledMessages>;
} }
impl<A: Actor> IntoActorHandle<A::HandledMessages> for A { impl<A: Actor> IntoActorHandle for A {
fn into_actor_handle(self) -> ActorHandle<A::HandledMessages> { type HandledMessages = A::HandledMessages;
fn into_actor_handle(self) -> ActorHandle<Self::HandledMessages> {
ActorHandle::new(self) ActorHandle::new(self)
} }
} }