diff --git a/crates/gpui3/src/element.rs b/crates/gpui3/src/element.rs index 534be128dd..ad4cfa97bc 100644 --- a/crates/gpui3/src/element.rs +++ b/crates/gpui3/src/element.rs @@ -82,31 +82,6 @@ pub trait ParentElement { .extend(iter.into_iter().map(|item| item.into_any())); self } - - // HACK: This is a temporary hack to get children working for the purposes - // of building UI on top of the current version of gpui2. - // - // We'll (hopefully) be moving away from this in the future. - fn children_any(mut self, children: I) -> Self - where - I: IntoIterator>, - Self: Sized, - { - self.children_mut().extend(children.into_iter()); - self - } - - // HACK: This is a temporary hack to get children working for the purposes - // of building UI on top of the current version of gpui2. - // - // We'll (hopefully) be moving away from this in the future. - fn child_any(mut self, children: AnyElement) -> Self - where - Self: Sized, - { - self.children_mut().push(children); - self - } } trait ElementObject: 'static + Send + Sync { diff --git a/crates/storybook2/src/stories/kitchen_sink.rs b/crates/storybook2/src/stories/kitchen_sink.rs index e0459098f5..83a773aa90 100644 --- a/crates/storybook2/src/stories/kitchen_sink.rs +++ b/crates/storybook2/src/stories/kitchen_sink.rs @@ -19,16 +19,20 @@ impl KitchenSinkStory { } fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { - let element_stories = ElementStory::iter().map(|selector| selector.story()); - let component_stories = ComponentStory::iter().map(|selector| selector.story(cx)).collect::>(); + let element_stories = ElementStory::iter() + .map(|selector| selector.story()) + .collect::>(); + let component_stories = ComponentStory::iter() + .map(|selector| selector.story(cx)) + .collect::>(); Story::container(cx) .overflow_y_scroll(ScrollState::default()) .child(Story::title(cx, "Kitchen Sink")) .child(Story::label(cx, "Elements")) - .child(div().flex().flex_col().children_any(element_stories)) + .child(div().flex().flex_col().children(element_stories)) .child(Story::label(cx, "Components")) - .child(div().flex().flex_col().children_any(component_stories)) + .child(div().flex().flex_col().children(component_stories)) // Add a bit of space at the bottom of the kitchen sink so elements // don't end up squished right up against the bottom of the screen. .child(div().p_4()) diff --git a/crates/storybook2/src/storybook2.rs b/crates/storybook2/src/storybook2.rs index 36f7219eaa..a1e6caf275 100644 --- a/crates/storybook2/src/storybook2.rs +++ b/crates/storybook2/src/storybook2.rs @@ -109,7 +109,7 @@ impl StoryWrapper { .flex() .flex_col() .size_full() - .child_any(self.selector.story(cx)) + .child(self.selector.story(cx)) }) } } diff --git a/crates/ui2/src/children.rs b/crates/ui2/src/children.rs deleted file mode 100644 index e9a55d1cc0..0000000000 --- a/crates/ui2/src/children.rs +++ /dev/null @@ -1,7 +0,0 @@ -use std::any::Any; - -use gpui3::{AnyElement, ViewContext}; - -pub type HackyChildren = fn(&mut ViewContext, &dyn Any) -> Vec>; - -pub type HackyChildrenPayload = Box; diff --git a/crates/ui2/src/lib.rs b/crates/ui2/src/lib.rs index 1aa09cd1ce..51489173ad 100644 --- a/crates/ui2/src/lib.rs +++ b/crates/ui2/src/lib.rs @@ -1,6 +1,5 @@ #![allow(dead_code, unused_variables)] -mod children; mod components; mod element_ext; mod elements; @@ -8,7 +7,6 @@ pub mod prelude; mod static_data; mod theme; -pub use children::*; pub use components::*; pub use element_ext::*; pub use elements::*; diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rs index 2d0342e765..618ad4807b 100644 --- a/crates/ui2/src/prelude.rs +++ b/crates/ui2/src/prelude.rs @@ -3,7 +3,7 @@ pub use gpui3::{ WindowContext, }; -pub use crate::{theme, ButtonVariant, ElementExt, HackyChildren, HackyChildrenPayload, Theme}; +pub use crate::{theme, ButtonVariant, ElementExt, Theme}; use gpui3::{hsla, rems, rgb, AbsoluteLength, Hsla}; use strum::EnumIter;