Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

WIP

Nathan Sobodb15db45ce51
diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs
index 4b5e61be4a5..87e1e5c8366 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<V: 'static>: IntoAnyElement<V> {
+pub trait Element<V: 'static> {
type ElementState: 'static;
fn id(&self) -> Option<ElementId>;
diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs
index f00e24b4724..f51516dbe52 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<V: 'static>: StatelessInteractive<V> {
S: Any + Send + Sync,
R: Fn(&mut V, &mut ViewContext<V>) -> E,
R: 'static + Send + Sync,
- E: Element<V>,
+ E: IntoAnyElement<V>,
{
debug_assert!(
self.stateful_interaction().drag_listener.is_none(),
@@ -871,7 +871,7 @@ pub struct Drag<S, R, V, E>
where
R: Fn(&mut V, &mut ViewContext<V>) -> E,
V: 'static,
- E: Element<V>,
+ E: IntoAnyElement<V>,
{
pub state: S,
pub render_drag_handle: R,
@@ -882,7 +882,7 @@ impl<S, R, V, E> Drag<S, R, V, E>
where
R: Fn(&mut V, &mut ViewContext<V>) -> E,
V: 'static,
- E: Element<V>,
+ E: IntoAnyElement<V>,
{
pub fn new(state: S, render_drag_handle: R) -> Self {
Drag {