diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs index 4b5e61be4a..87e1e5c836 100644 --- a/crates/gpui2/src/element.rs +++ b/crates/gpui2/src/element.rs @@ -3,7 +3,7 @@ use derive_more::{Deref, DerefMut}; pub(crate) use smallvec::SmallVec; use std::{any::Any, mem}; -pub trait Element: IntoAnyElement { +pub trait Element { type ElementState: 'static; fn id(&self) -> Option; diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs index f00e24b472..f51516dbe5 100644 --- a/crates/gpui2/src/interactive.rs +++ b/crates/gpui2/src/interactive.rs @@ -1,7 +1,7 @@ use crate::{ point, px, view, Action, AnyBox, AnyDrag, AppContext, BorrowWindow, Bounds, DispatchContext, - DispatchPhase, Element, ElementId, FocusHandle, KeyMatch, Keystroke, Modifiers, Overflow, - Pixels, Point, SharedString, Size, Style, StyleRefinement, ViewContext, + DispatchPhase, Element, ElementId, FocusHandle, IntoAnyElement, KeyMatch, Keystroke, Modifiers, + Overflow, Pixels, Point, SharedString, Size, Style, StyleRefinement, ViewContext, }; use collections::HashMap; use derive_more::{Deref, DerefMut}; @@ -327,7 +327,7 @@ pub trait StatefulInteractive: StatelessInteractive { S: Any + Send + Sync, R: Fn(&mut V, &mut ViewContext) -> E, R: 'static + Send + Sync, - E: Element, + E: IntoAnyElement, { debug_assert!( self.stateful_interaction().drag_listener.is_none(), @@ -871,7 +871,7 @@ pub struct Drag where R: Fn(&mut V, &mut ViewContext) -> E, V: 'static, - E: Element, + E: IntoAnyElement, { pub state: S, pub render_drag_handle: R, @@ -882,7 +882,7 @@ impl Drag where R: Fn(&mut V, &mut ViewContext) -> E, V: 'static, - E: Element, + E: IntoAnyElement, { pub fn new(state: S, render_drag_handle: R) -> Self { Drag {