diff --git a/crates/corro-types/src/actor.rs b/crates/corro-types/src/actor.rs index f061f0512..66c545f10 100644 --- a/crates/corro-types/src/actor.rs +++ b/crates/corro-types/src/actor.rs @@ -199,35 +199,15 @@ impl From for Actor { } } -pub struct ActorAddr { - id: ActorId, - addr: SocketAddr, -} - -impl PartialEq for ActorAddr { - fn eq(&self, other: &Self) -> bool { - // this happens if we're announcing ourselves to another node - // we don't yet have any info about them, except their gossip addr - if self.id.is_nil() || other.id.is_nil() { - self.addr.eq(&other.addr) - } else { - self.id.eq(&other.id) - } - } -} - impl Identity for Actor { - type Addr = ActorAddr; + type Addr = SocketAddr; // Since a client outside the cluster will not be aware of our // `bump` field, we implement the optional trait method // `has_same_prefix` to allow anyone that knows our `addr` // to join our cluster. fn addr(&self) -> Self::Addr { - ActorAddr { - id: self.id, - addr: self.addr, - } + self.addr } // And by implementing `renew` we enable automatic rejoining: