Checkpoint

Nathan Sobo created

Change summary

crates/gpui3/src/element.rs             |  6 ++++++
crates/gpui3/src/elements/hoverable.rs  |  4 ++--
crates/gpui3/src/elements/identified.rs | 10 ++--------
3 files changed, 10 insertions(+), 10 deletions(-)

Detailed changes

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]>);
 

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> {}

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> {}