diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index 2c8c9aadbe..76004f14a4 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -457,10 +457,10 @@ impl Client { cx: &mut ViewContext, ) -> Subscription { let id = (TypeId::of::(), remote_id); - self.state.write().entities_by_type_and_remote_id.insert( - id, - WeakSubscriber::View((&cx.weak_handle() as &AnyWeakViewHandle).clone()), - ); + self.state + .write() + .entities_by_type_and_remote_id + .insert(id, WeakSubscriber::View(cx.weak_handle().into_any())); Subscription::Entity { client: Arc::downgrade(self), id,