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;
}
pub trait IntoActorHandle<MB> {
fn into_actor_handle(self) -> ActorHandle<MB>;
pub trait IntoActorHandle {
type HandledMessages: MessageBundle;
fn into_actor_handle(self) -> ActorHandle<Self::HandledMessages>;
}
impl<A: Actor> IntoActorHandle<A::HandledMessages> for A {
fn into_actor_handle(self) -> ActorHandle<A::HandledMessages> {
impl<A: Actor> IntoActorHandle for A {
type HandledMessages = A::HandledMessages;
fn into_actor_handle(self) -> ActorHandle<Self::HandledMessages> {
ActorHandle::new(self)
}
}