use gpui2::Element; pub trait ElementExt: Element { // fn when(mut self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self // where // Self: Sized, // { // if condition { // self = then(self); // } // self // } // fn when_some(mut self, option: Option, then: impl FnOnce(Self, T) -> U) -> U // where // Self: Sized, // { // if let Some(value) = option { // self = then(self, value); // } // self // } } impl> ElementExt for E {}