Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ui2: Remove `ElementExt` trait
Marshall Bowersed233d583f60
diff --git a/crates/ui2/src/element_ext.rs b/crates/ui2/src/element_ext.rsdeleted file mode 100644index bbdf6ded42f..00000000000--- a/crates/ui2/src/element_ext.rs+++ /dev/null@@ -1,25 +0,0 @@-use gpui2::Element;--pub trait ElementExt<V: 'static>: Element<V> {- // fn when(mut self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self- // where- // Self: Sized,- // {- // if condition {- // self = then(self);- // }- // self- // }-- // fn when_some<T, U>(mut self, option: Option<T>, then: impl FnOnce(Self, T) -> U) -> U- // where- // Self: Sized,- // {- // if let Some(value) = option {- // self = then(self, value);- // }- // self- // }-}--impl<S: 'static, E: Element<S>> ElementExt<S> for E {}diff --git a/crates/ui2/src/lib.rs b/crates/ui2/src/lib.rsindex d13271ce05b..689e9c53723 100644--- a/crates/ui2/src/lib.rs+++ b/crates/ui2/src/lib.rs@@ -18,7 +18,6 @@#![allow(dead_code, unused_variables)]mod components;-mod element_ext;mod elements;mod elevation;pub mod prelude;@@ -27,7 +26,6 @@ mod static_data;mod theme;pub use components::*;-pub use element_ext::*;pub use elements::*;pub use prelude::*;pub use static_data::*;diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rsindex 8098d3e40b3..b8143b6e504 100644--- a/crates/ui2/src/prelude.rs+++ b/crates/ui2/src/prelude.rs@@ -1,11 +1,11 @@pub use gpui2::{- div, Element, ElementId, Component, ParentElement, SharedString, StatefulInteractive,+ div, Component, Element, ElementId, ParentElement, SharedString, StatefulInteractive,StatelessInteractive, Styled, ViewContext, WindowContext,};pub use crate::elevation::*;use crate::settings::user_settings;-pub use crate::{old_theme, theme, ButtonVariant, ElementExt, Theme};+pub use crate::{old_theme, theme, ButtonVariant, Theme};use gpui2::{rems, Hsla, Rems};use strum::EnumIter;