diff --git a/crates/gpui2/src/app/async_context.rs b/crates/gpui2/src/app/async_context.rs index 823031b11a2100e3d590b365f1ebd608de5f5ff2..1f46578a97ac57a7b06ef88599382f4d292b11c8 100644 --- a/crates/gpui2/src/app/async_context.rs +++ b/crates/gpui2/src/app/async_context.rs @@ -254,7 +254,7 @@ impl VisualContext for AsyncWindowContext { build_view: impl FnOnce(&mut ViewContext<'_, V>) -> V, ) -> Self::Result> where - V: 'static + Send + Render, + V: Render, { self.window .update(self, |_, cx| cx.replace_root_view(build_view)) diff --git a/crates/gpui2/src/gpui2.rs b/crates/gpui2/src/gpui2.rs index bd65ade0d3f3d7fd2c842fb6657a583fee01e55b..9ba0cb5d8a13ab51cf9048024e910924e654d0ba 100644 --- a/crates/gpui2/src/gpui2.rs +++ b/crates/gpui2/src/gpui2.rs @@ -113,7 +113,7 @@ pub trait VisualContext: Context { build_view: impl FnOnce(&mut ViewContext<'_, V>) -> V, ) -> Self::Result> where - V: 'static + Send + Render; + V: Render; } pub trait Entity: Sealed { diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs index 4435b0e9275f43d8dd20da5afc884b33f28e9cc8..a3d9eeb8bf6c46f48ad472fc5a1a10905f4bd57f 100644 --- a/crates/gpui2/src/window.rs +++ b/crates/gpui2/src/window.rs @@ -1310,7 +1310,7 @@ impl VisualContext for WindowContext<'_> { build_view: impl FnOnce(&mut ViewContext<'_, V>) -> V, ) -> Self::Result> where - V: 'static + Send + Render, + V: Render, { let slot = self.app.entities.reserve(); let view = View { @@ -1598,7 +1598,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn observe( &mut self, entity: &E, - mut on_notify: impl FnMut(&mut V, E, &mut ViewContext<'_, V>) + Send + 'static, + mut on_notify: impl FnMut(&mut V, E, &mut ViewContext<'_, V>) + 'static, ) -> Subscription where V2: 'static, @@ -1629,7 +1629,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn subscribe( &mut self, entity: &E, - mut on_event: impl FnMut(&mut V, E, &V2::Event, &mut ViewContext<'_, V>) + Send + 'static, + mut on_event: impl FnMut(&mut V, E, &V2::Event, &mut ViewContext<'_, V>) + 'static, ) -> Subscription where V2: EventEmitter, @@ -1659,7 +1659,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn on_release( &mut self, - on_release: impl FnOnce(&mut V, &mut WindowContext) + Send + 'static, + on_release: impl FnOnce(&mut V, &mut WindowContext) + 'static, ) -> Subscription { let window_handle = self.window.handle; self.app.release_listeners.insert( @@ -1674,10 +1674,10 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn observe_release( &mut self, entity: &E, - mut on_release: impl FnMut(&mut V, &mut V2, &mut ViewContext<'_, V>) + Send + 'static, + mut on_release: impl FnMut(&mut V, &mut V2, &mut ViewContext<'_, V>) + 'static, ) -> Subscription where - V: Any + Send, + V: 'static, V2: 'static, E: Entity, { @@ -1704,7 +1704,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn on_focus_changed( &mut self, - listener: impl Fn(&mut V, &FocusEvent, &mut ViewContext) + Send + 'static, + listener: impl Fn(&mut V, &FocusEvent, &mut ViewContext) + 'static, ) { let handle = self.view().downgrade(); self.window.focus_listeners.push(Box::new(move |event, cx| { @@ -1814,7 +1814,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn update_global(&mut self, f: impl FnOnce(&mut G, &mut Self) -> R) -> R where - G: 'static + Send, + G: 'static, { let mut global = self.app.lease_global::(); let result = f(&mut global, self); @@ -1824,7 +1824,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { pub fn observe_global( &mut self, - f: impl Fn(&mut V, &mut ViewContext<'_, V>) + Send + 'static, + f: impl Fn(&mut V, &mut ViewContext<'_, V>) + 'static, ) -> Subscription { let window_handle = self.window.handle; let view = self.view().downgrade(); @@ -1854,7 +1854,7 @@ impl<'a, V: 'static> ViewContext<'a, V> { impl ViewContext<'_, V> where V: EventEmitter, - V::Event: 'static + Send, + V::Event: 'static, { pub fn emit(&mut self, event: V::Event) { let emitter = self.view.model.entity_id; @@ -1904,7 +1904,7 @@ impl VisualContext for ViewContext<'_, V> { view: &View, update: impl FnOnce(&mut V2, &mut ViewContext<'_, V2>) -> R, ) -> Self::Result { - VisualContext::update_view(&mut self.window_cx, view, update) + self.window_cx.update_view(view, update) } fn replace_root_view( @@ -1912,7 +1912,7 @@ impl VisualContext for ViewContext<'_, V> { build_view: impl FnOnce(&mut ViewContext<'_, W>) -> W, ) -> Self::Result> where - W: 'static + Send + Render, + W: Render, { self.window_cx.replace_root_view(build_view) }