From a4bde421dbde35253fc4980cfa9d2b5c96adbb1d Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Sat, 7 Oct 2023 10:50:50 -0400 Subject: [PATCH 1/2] Revert changes to `gpui2` crate --- crates/gpui2/src/color.rs | 9 -------- crates/gpui2/src/elements/text.rs | 14 ++---------- crates/gpui2/src/gpui2.rs | 1 - crates/gpui2/src/style.rs | 4 +--- crates/gpui2/src/view_context.rs | 37 +------------------------------ 5 files changed, 4 insertions(+), 61 deletions(-) diff --git a/crates/gpui2/src/color.rs b/crates/gpui2/src/color.rs index b128ea691c..11590f967c 100644 --- a/crates/gpui2/src/color.rs +++ b/crates/gpui2/src/color.rs @@ -160,15 +160,6 @@ pub fn black() -> Hsla { } } -pub fn white() -> Hsla { - Hsla { - h: 0., - s: 0., - l: 1., - a: 1., - } -} - impl From for Hsla { fn from(color: Rgba) -> Self { let r = color.r; diff --git a/crates/gpui2/src/elements/text.rs b/crates/gpui2/src/elements/text.rs index 3ee35eea30..323b3d9f89 100644 --- a/crates/gpui2/src/elements/text.rs +++ b/crates/gpui2/src/elements/text.rs @@ -12,21 +12,11 @@ use parking_lot::Mutex; use std::sync::Arc; use util::arc_cow::ArcCow; -impl IntoElement for ArcCow<'static, str> { +impl>> IntoElement for S { type Element = Text; fn into_element(self) -> Self::Element { - Text { text: self } - } -} - -impl IntoElement for &'static str { - type Element = Text; - - fn into_element(self) -> Self::Element { - Text { - text: ArcCow::from(self), - } + Text { text: self.into() } } } diff --git a/crates/gpui2/src/gpui2.rs b/crates/gpui2/src/gpui2.rs index b10b6629b5..355697595f 100644 --- a/crates/gpui2/src/gpui2.rs +++ b/crates/gpui2/src/gpui2.rs @@ -6,7 +6,6 @@ pub mod interactive; pub mod style; pub mod view; pub mod view_context; -pub mod view_handle; pub use color::*; pub use element::{AnyElement, Element, IntoElement, Layout, ParentElement}; diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index dc25bb4b22..ecb9d79a6c 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -22,8 +22,6 @@ use gpui2_macros::styleable_helpers; use refineable::{Refineable, RefinementCascade}; use std::sync::Arc; -pub type StyleCascade = RefinementCascade