ui2: Remove `ElementExt` trait

Marshall Bowers created

Change summary

crates/ui2/src/element_ext.rs | 25 -------------------------
crates/ui2/src/lib.rs         |  2 --
crates/ui2/src/prelude.rs     |  4 ++--
3 files changed, 2 insertions(+), 29 deletions(-)

Detailed changes

crates/ui2/src/element_ext.rs 🔗

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

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::*;

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;