Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Checkpoint
Nathan Soboe71465347896
diff --git a/crates/gpui3/src/element.rs b/crates/gpui3/src/element.rsindex f205a01433c..3eb2af914ef 100644--- a/crates/gpui3/src/element.rs+++ b/crates/gpui3/src/element.rs@@ -33,6 +33,12 @@ pub trait Element: 'static {}}+pub trait StatefulElement: Element {+ fn element_id(&self) -> ElementId {+ Element::element_id(self).unwrap()+ }+}+#[derive(Clone, Debug, Eq, PartialEq, Hash)]pub struct ElementId(ArcCow<'static, [u8]>);diff --git a/crates/gpui3/src/elements/hoverable.rs b/crates/gpui3/src/elements/hoverable.rsindex 4595ddf6f8f..ddd6782afc4 100644--- a/crates/gpui3/src/elements/hoverable.rs+++ b/crates/gpui3/src/elements/hoverable.rs@@ -1,6 +1,6 @@use crate::{AnyElement, Bounds, DispatchPhase, Element, ElementId, Interactive, MouseEventListeners,- MouseMoveEvent, ParentElement, Pixels, Stateful, Styled, ViewContext,+ MouseMoveEvent, ParentElement, Pixels, StatefulElement, Styled, ViewContext,};use anyhow::Result;use refineable::{CascadeSlot, Refineable, RefinementCascade};@@ -100,4 +100,4 @@ impl<E: ParentElement + Styled> ParentElement for Hoverable<E> {}}-impl<E: Stateful + Styled> Stateful for Hoverable<E> {}+impl<E: StatefulElement + Styled> StatefulElement for Hoverable<E> {}diff --git a/crates/gpui3/src/elements/identified.rs b/crates/gpui3/src/elements/identified.rsindex b93a3fd1cf4..1cbbbb99ce7 100644--- a/crates/gpui3/src/elements/identified.rs+++ b/crates/gpui3/src/elements/identified.rs@@ -1,12 +1,6 @@-use crate::{BorrowWindow, Bounds, Element, ElementId, LayoutId, ViewContext};+use crate::{BorrowWindow, Bounds, Element, ElementId, LayoutId, StatefulElement, ViewContext};use anyhow::Result;-pub trait Stateful: Element {- fn element_id(&self) -> ElementId {- Element::element_id(self).unwrap()- }-}-pub struct Identified<E> {pub(crate) element: E,pub(crate) id: ElementId,@@ -41,4 +35,4 @@ impl<E: Element> Element for Identified<E> {}}-impl<E: Element> Stateful for Identified<E> {}+impl<E: Element> StatefulElement for Identified<E> {}