ui2: Remove ElementExt trait

This commit is contained in:
Marshall Bowers 2023-10-26 15:59:18 +02:00
parent 6784ccd9fe
commit ed233d583f
3 changed files with 2 additions and 29 deletions

View file

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

View file

@ -18,7 +18,6 @@
#![allow(dead_code, unused_variables)] #![allow(dead_code, unused_variables)]
mod components; mod components;
mod element_ext;
mod elements; mod elements;
mod elevation; mod elevation;
pub mod prelude; pub mod prelude;
@ -27,7 +26,6 @@ mod static_data;
mod theme; mod theme;
pub use components::*; pub use components::*;
pub use element_ext::*;
pub use elements::*; pub use elements::*;
pub use prelude::*; pub use prelude::*;
pub use static_data::*; pub use static_data::*;

View file

@ -1,11 +1,11 @@
pub use gpui2::{ pub use gpui2::{
div, Element, ElementId, Component, ParentElement, SharedString, StatefulInteractive, div, Component, Element, ElementId, ParentElement, SharedString, StatefulInteractive,
StatelessInteractive, Styled, ViewContext, WindowContext, StatelessInteractive, Styled, ViewContext, WindowContext,
}; };
pub use crate::elevation::*; pub use crate::elevation::*;
use crate::settings::user_settings; 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 gpui2::{rems, Hsla, Rems};
use strum::EnumIter; use strum::EnumIter;