Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Nathan Sobo0069dd5ce679
diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rsindex b4b1af630e9..26232620d97 100644--- a/crates/gpui2/src/element.rs+++ b/crates/gpui2/src/element.rs@@ -5,7 +5,7 @@ use derive_more::{Deref, DerefMut};pub(crate) use smallvec::SmallVec;use std::{any::Any, fmt::Debug, mem};-pub trait Element<V: 'static> {+pub trait Element<V: 'static>: 'static + Sized {type ElementState: 'static;fn element_id(&self) -> Option<ElementId>;@@ -25,6 +25,10 @@ pub trait Element<V: 'static> {cx: &mut ViewContext<V>,);+ fn into_any(self) -> AnyElement<V> {+ AnyElement::new(self)+ }+fn draw<T, R>(self,origin: Point<Pixels>,@@ -34,7 +38,6 @@ pub trait Element<V: 'static> {f: impl FnOnce(&Self::ElementState, &mut ViewContext<V>) -> R,) -> Rwhere- Self: Sized,T: Clone + Default + Debug + Into<AvailableSpace>,{let mut element = RenderedElement {