diff --git a/crates/gpui3/src/element.rs b/crates/gpui3/src/element.rs index f205a01433c609f372f5da20e5a5e955e5b15de8..3eb2af914ef7b177d8a131d9e856c538aa1b2073 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.rs index 4595ddf6f8f4cee2e4f83c9eb6280f5430bd41c7..ddd6782afc46cd364c4ba77715e846df649f141a 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 ParentElement for Hoverable { } } -impl Stateful for Hoverable {} +impl StatefulElement for Hoverable {} diff --git a/crates/gpui3/src/elements/identified.rs b/crates/gpui3/src/elements/identified.rs index b93a3fd1cf4e6ef0b44aba1ca6c1336a4a0f6e3c..1cbbbb99ce7c84d3a8683a96f2b59b2dedba6710 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 { pub(crate) element: E, pub(crate) id: ElementId, @@ -41,4 +35,4 @@ impl Element for Identified { } } -impl Stateful for Identified {} +impl StatefulElement for Identified {}