From 61694bba6a51e0bbe219610997591c3ef5f632cf Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 26 Oct 2023 16:46:49 +0200 Subject: [PATCH] Remove unneeded constructors for stories --- crates/storybook2/src/stories/z_index.rs | 4 - crates/storybook2/src/story_selector.rs | 158 +++++++----------- crates/ui2/src/components/assistant_panel.rs | 6 +- crates/ui2/src/components/breadcrumb.rs | 4 - crates/ui2/src/components/buffer.rs | 4 - crates/ui2/src/components/chat_panel.rs | 4 - crates/ui2/src/components/collab_panel.rs | 4 - crates/ui2/src/components/command_palette.rs | 4 - crates/ui2/src/components/context_menu.rs | 4 - crates/ui2/src/components/copilot.rs | 4 - crates/ui2/src/components/facepile.rs | 4 - crates/ui2/src/components/icon_button.rs | 5 +- crates/ui2/src/components/keybinding.rs | 4 - .../ui2/src/components/language_selector.rs | 4 - crates/ui2/src/components/multi_buffer.rs | 4 - .../ui2/src/components/notifications_panel.rs | 4 - crates/ui2/src/components/palette.rs | 4 - crates/ui2/src/components/panel.rs | 4 - crates/ui2/src/components/project_panel.rs | 4 - crates/ui2/src/components/recent_projects.rs | 4 - crates/ui2/src/components/tab.rs | 4 - crates/ui2/src/components/tab_bar.rs | 4 - crates/ui2/src/components/terminal.rs | 4 - crates/ui2/src/components/theme_selector.rs | 4 - crates/ui2/src/components/toast.rs | 4 - crates/ui2/src/components/toolbar.rs | 4 - crates/ui2/src/components/traffic_lights.rs | 4 - crates/ui2/src/elements/avatar.rs | 4 - crates/ui2/src/elements/button.rs | 4 - crates/ui2/src/elements/details.rs | 4 - crates/ui2/src/elements/icon.rs | 4 - crates/ui2/src/elements/input.rs | 4 - crates/ui2/src/elements/label.rs | 4 - 33 files changed, 62 insertions(+), 227 deletions(-) diff --git a/crates/storybook2/src/stories/z_index.rs b/crates/storybook2/src/stories/z_index.rs index 15f66fc26a2a78da19dcc6a729258e3fc9d47227..f17280405ad95629e6977543a0fd858a4b31e03d 100644 --- a/crates/storybook2/src/stories/z_index.rs +++ b/crates/storybook2/src/stories/z_index.rs @@ -10,10 +10,6 @@ use crate::story::Story; pub struct ZIndexStory; impl ZIndexStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title(cx, "z-index")) diff --git a/crates/storybook2/src/story_selector.rs b/crates/storybook2/src/story_selector.rs index 5f60ad14eaddf51323f92ecb9c509951df7b8eb3..ed6822cb1140ce66121b340304c51976c8518cb4 100644 --- a/crates/storybook2/src/story_selector.rs +++ b/crates/storybook2/src/story_selector.rs @@ -27,31 +27,16 @@ pub enum ElementStory { impl ElementStory { pub fn story(&self, cx: &mut WindowContext) -> AnyView { match self { - Self::Avatar => { - view(cx.entity(|cx| ()), |_, _| ui::AvatarStory::new().render()).into_any() - } - Self::Button => { - view(cx.entity(|cx| ()), |_, _| ui::ButtonStory::new().render()).into_any() - } - Self::Details => view(cx.entity(|cx| ()), |_, _| { - ui::DetailsStory::new().render() - }) - .into_any(), + Self::Avatar => view(cx.entity(|cx| ()), |_, _| ui::AvatarStory.render()).into_any(), + Self::Button => view(cx.entity(|cx| ()), |_, _| ui::ButtonStory.render()).into_any(), + Self::Details => view(cx.entity(|cx| ()), |_, _| ui::DetailsStory.render()).into_any(), Self::Focus => FocusStory::view(cx).into_any(), - Self::Icon => { - view(cx.entity(|cx| ()), |_, _| ui::IconStory::new().render()).into_any() - } - Self::Input => { - view(cx.entity(|cx| ()), |_, _| ui::InputStory::new().render()).into_any() - } - Self::Label => { - view(cx.entity(|cx| ()), |_, _| ui::LabelStory::new().render()).into_any() - } + Self::Icon => view(cx.entity(|cx| ()), |_, _| ui::IconStory.render()).into_any(), + Self::Input => view(cx.entity(|cx| ()), |_, _| ui::InputStory.render()).into_any(), + Self::Label => view(cx.entity(|cx| ()), |_, _| ui::LabelStory.render()).into_any(), Self::Scroll => ScrollStory::view(cx).into_any(), Self::Text => TextStory::view(cx).into_any(), - Self::ZIndex => { - view(cx.entity(|cx| ()), |_, _| ZIndexStory::new().render()).into_any() - } + Self::ZIndex => view(cx.entity(|cx| ()), |_, _| ZIndexStory.render()).into_any(), } } } @@ -90,96 +75,67 @@ pub enum ComponentStory { impl ComponentStory { pub fn story(&self, cx: &mut WindowContext) -> AnyView { match self { - Self::AssistantPanel => view(cx.entity(|cx| ()), |_, _| { - ui::AssistantPanelStory::new().render() - }) - .into_any(), - Self::Buffer => { - view(cx.entity(|cx| ()), |_, _| ui::BufferStory::new().render()).into_any() + Self::AssistantPanel => { + view(cx.entity(|cx| ()), |_, _| ui::AssistantPanelStory.render()).into_any() + } + Self::Buffer => view(cx.entity(|cx| ()), |_, _| ui::BufferStory.render()).into_any(), + Self::Breadcrumb => { + view(cx.entity(|cx| ()), |_, _| ui::BreadcrumbStory.render()).into_any() + } + Self::ChatPanel => { + view(cx.entity(|cx| ()), |_, _| ui::ChatPanelStory.render()).into_any() + } + Self::CollabPanel => { + view(cx.entity(|cx| ()), |_, _| ui::CollabPanelStory.render()).into_any() + } + Self::CommandPalette => { + view(cx.entity(|cx| ()), |_, _| ui::CommandPaletteStory.render()).into_any() + } + Self::ContextMenu => { + view(cx.entity(|cx| ()), |_, _| ui::ContextMenuStory.render()).into_any() + } + Self::Facepile => { + view(cx.entity(|cx| ()), |_, _| ui::FacepileStory.render()).into_any() + } + Self::Keybinding => { + view(cx.entity(|cx| ()), |_, _| ui::KeybindingStory.render()).into_any() } - Self::Breadcrumb => view(cx.entity(|cx| ()), |_, _| { - ui::BreadcrumbStory::new().render() - }) - .into_any(), - Self::ChatPanel => view(cx.entity(|cx| ()), |_, _| { - ui::ChatPanelStory::new().render() - }) - .into_any(), - Self::CollabPanel => view(cx.entity(|cx| ()), |_, _| { - ui::CollabPanelStory::new().render() - }) - .into_any(), - Self::CommandPalette => view(cx.entity(|cx| ()), |_, _| { - ui::CommandPaletteStory::new().render() - }) - .into_any(), - Self::ContextMenu => view(cx.entity(|cx| ()), |_, _| { - ui::ContextMenuStory::new().render() - }) - .into_any(), - Self::Facepile => view(cx.entity(|cx| ()), |_, _| { - ui::FacepileStory::new().render() - }) - .into_any(), - Self::Keybinding => view(cx.entity(|cx| ()), |_, _| { - ui::KeybindingStory::new().render() - }) - .into_any(), Self::LanguageSelector => view(cx.entity(|cx| ()), |_, _| { - ui::LanguageSelectorStory::new().render() - }) - .into_any(), - Self::MultiBuffer => view(cx.entity(|cx| ()), |_, _| { - ui::MultiBufferStory::new().render() + ui::LanguageSelectorStory.render() }) .into_any(), + Self::MultiBuffer => { + view(cx.entity(|cx| ()), |_, _| ui::MultiBufferStory.render()).into_any() + } Self::NotificationsPanel => view(cx.entity(|cx| ()), |_, _| { - ui::NotificationsPanelStory::new().render() + ui::NotificationsPanelStory.render() }) .into_any(), - Self::Palette => view(cx.entity(|cx| ()), |_, _| { - ui::PaletteStory::new().render() - }) - .into_any(), - Self::Panel => { - view(cx.entity(|cx| ()), |_, _| ui::PanelStory::new().render()).into_any() + Self::Palette => view(cx.entity(|cx| ()), |_, _| ui::PaletteStory.render()).into_any(), + Self::Panel => view(cx.entity(|cx| ()), |_, _| ui::PanelStory.render()).into_any(), + Self::ProjectPanel => { + view(cx.entity(|cx| ()), |_, _| ui::ProjectPanelStory.render()).into_any() } - Self::ProjectPanel => view(cx.entity(|cx| ()), |_, _| { - ui::ProjectPanelStory::new().render() - }) - .into_any(), - Self::RecentProjects => view(cx.entity(|cx| ()), |_, _| { - ui::RecentProjectsStory::new().render() - }) - .into_any(), - Self::Tab => view(cx.entity(|cx| ()), |_, _| ui::TabStory::new().render()).into_any(), - Self::TabBar => { - view(cx.entity(|cx| ()), |_, _| ui::TabBarStory::new().render()).into_any() + Self::RecentProjects => { + view(cx.entity(|cx| ()), |_, _| ui::RecentProjectsStory.render()).into_any() + } + Self::Tab => view(cx.entity(|cx| ()), |_, _| ui::TabStory.render()).into_any(), + Self::TabBar => view(cx.entity(|cx| ()), |_, _| ui::TabBarStory.render()).into_any(), + Self::Terminal => { + view(cx.entity(|cx| ()), |_, _| ui::TerminalStory.render()).into_any() + } + Self::ThemeSelector => { + view(cx.entity(|cx| ()), |_, _| ui::ThemeSelectorStory.render()).into_any() } - Self::Terminal => view(cx.entity(|cx| ()), |_, _| { - ui::TerminalStory::new().render() - }) - .into_any(), - Self::ThemeSelector => view(cx.entity(|cx| ()), |_, _| { - ui::ThemeSelectorStory::new().render() - }) - .into_any(), Self::TitleBar => ui::TitleBarStory::view(cx).into_any(), - Self::Toast => { - view(cx.entity(|cx| ()), |_, _| ui::ToastStory::new().render()).into_any() + Self::Toast => view(cx.entity(|cx| ()), |_, _| ui::ToastStory.render()).into_any(), + Self::Toolbar => view(cx.entity(|cx| ()), |_, _| ui::ToolbarStory.render()).into_any(), + Self::TrafficLights => { + view(cx.entity(|cx| ()), |_, _| ui::TrafficLightsStory.render()).into_any() + } + Self::Copilot => { + view(cx.entity(|cx| ()), |_, _| ui::CopilotModalStory.render()).into_any() } - Self::Toolbar => view(cx.entity(|cx| ()), |_, _| { - ui::ToolbarStory::new().render() - }) - .into_any(), - Self::TrafficLights => view(cx.entity(|cx| ()), |_, _| { - ui::TrafficLightsStory::new().render() - }) - .into_any(), - Self::Copilot => view(cx.entity(|cx| ()), |_, _| { - ui::CopilotModalStory::new().render() - }) - .into_any(), Self::Workspace => ui::WorkspaceStory::view(cx).into_any(), } } diff --git a/crates/ui2/src/components/assistant_panel.rs b/crates/ui2/src/components/assistant_panel.rs index defd05f500904e1b6a4974300c49df8f35745fe9..9b2abd5c1741fd11b77a44c0c49969dbfc05ae23 100644 --- a/crates/ui2/src/components/assistant_panel.rs +++ b/crates/ui2/src/components/assistant_panel.rs @@ -81,13 +81,9 @@ mod stories { use super::*; #[derive(Component)] - pub struct AssistantPanelStory {} + pub struct AssistantPanelStory; impl AssistantPanelStory { - pub fn new() -> Self { - Self {} - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, AssistantPanel>(cx)) diff --git a/crates/ui2/src/components/breadcrumb.rs b/crates/ui2/src/components/breadcrumb.rs index 37660b5b0b95874c8dee3e6fd6732f123e283f8e..4a2cebcb803f90a2f304f28611fe029c8c581019 100644 --- a/crates/ui2/src/components/breadcrumb.rs +++ b/crates/ui2/src/components/breadcrumb.rs @@ -83,10 +83,6 @@ mod stories { pub struct BreadcrumbStory; impl BreadcrumbStory { - pub fn new() -> Self { - Self - } - fn render( self, view_state: &mut V, diff --git a/crates/ui2/src/components/buffer.rs b/crates/ui2/src/components/buffer.rs index 8250a6b9ee8db07a075b2a72418efe2ebb991259..57543977192d0d243c29c01e5a59a65597f89444 100644 --- a/crates/ui2/src/components/buffer.rs +++ b/crates/ui2/src/components/buffer.rs @@ -246,10 +246,6 @@ mod stories { pub struct BufferStory; impl BufferStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let theme = theme(cx); diff --git a/crates/ui2/src/components/chat_panel.rs b/crates/ui2/src/components/chat_panel.rs index 10e9e2a70680759c8326be3b644889ce189191ee..d4fddebc1bc1d4ffe968e5129f0c4f22bcabd6b3 100644 --- a/crates/ui2/src/components/chat_panel.rs +++ b/crates/ui2/src/components/chat_panel.rs @@ -117,10 +117,6 @@ mod stories { pub struct ChatPanelStory; impl ChatPanelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, ChatPanel>(cx)) diff --git a/crates/ui2/src/components/collab_panel.rs b/crates/ui2/src/components/collab_panel.rs index b8d0510f8fc2d09fb001d4fa39ea422e18c0814a..d14c1fec1e0523404302db1ee8e8c230c722ff7c 100644 --- a/crates/ui2/src/components/collab_panel.rs +++ b/crates/ui2/src/components/collab_panel.rs @@ -97,10 +97,6 @@ mod stories { pub struct CollabPanelStory; impl CollabPanelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, CollabPanel>(cx)) diff --git a/crates/ui2/src/components/command_palette.rs b/crates/ui2/src/components/command_palette.rs index 038dc7f460bf21c3d8aeca6c96ae816acda69502..71ca5bc41b4ed7dbf063d8c9633d7650bd369ffe 100644 --- a/crates/ui2/src/components/command_palette.rs +++ b/crates/ui2/src/components/command_palette.rs @@ -35,10 +35,6 @@ mod stories { pub struct CommandPaletteStory; impl CommandPaletteStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, CommandPalette>(cx)) diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rs index f39df6879dce3d804389bc0ea8be8b60ad87c939..f2a5557f17c2bba35004def7ca7e15a3a50fe7f5 100644 --- a/crates/ui2/src/components/context_menu.rs +++ b/crates/ui2/src/components/context_menu.rs @@ -76,10 +76,6 @@ mod stories { pub struct ContextMenuStory; impl ContextMenuStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, ContextMenu>(cx)) diff --git a/crates/ui2/src/components/copilot.rs b/crates/ui2/src/components/copilot.rs index a33dc1a0b78df05501dda4b99fc4743af810e0fa..7a565d090723d5ac59fff91c3f68caeb5c791b02 100644 --- a/crates/ui2/src/components/copilot.rs +++ b/crates/ui2/src/components/copilot.rs @@ -33,10 +33,6 @@ mod stories { pub struct CopilotModalStory; impl CopilotModalStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, CopilotModal>(cx)) diff --git a/crates/ui2/src/components/facepile.rs b/crates/ui2/src/components/facepile.rs index 1d0f435eacfed5e36a8a30fc31a944348ab34e6b..ab1ae471393b9d3c998b87d0f4b59007da9e1050 100644 --- a/crates/ui2/src/components/facepile.rs +++ b/crates/ui2/src/components/facepile.rs @@ -39,10 +39,6 @@ mod stories { pub struct FacepileStory; impl FacepileStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let players = static_players(); diff --git a/crates/ui2/src/components/icon_button.rs b/crates/ui2/src/components/icon_button.rs index b591c937b00cef0791d5c837f171447c32237c0c..980a1c98aac4ff90d8b708cacea161ba59d3f993 100644 --- a/crates/ui2/src/components/icon_button.rs +++ b/crates/ui2/src/components/icon_button.rs @@ -57,7 +57,10 @@ impl IconButton { self } - pub fn on_click(mut self, handler: impl 'static + Fn(&mut V, &mut ViewContext) + Send + Sync) -> Self { + pub fn on_click( + mut self, + handler: impl 'static + Fn(&mut V, &mut ViewContext) + Send + Sync, + ) -> Self { self.handlers.click = Some(Arc::new(handler)); self } diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 822cdd1dcb6a1cf2858943cde4013c9bd3f06f5d..ec29e7a95d2a1f50161dfdd710c96388209ff76e 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -168,10 +168,6 @@ mod stories { pub struct KeybindingStory; impl KeybindingStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let all_modifier_permutations = ModifierKey::iter().permutations(2); diff --git a/crates/ui2/src/components/language_selector.rs b/crates/ui2/src/components/language_selector.rs index 92af80cd76c9e9484d96b3b502f8a66d97cddc6f..f75dcf3eaffb8b56bc8a135456cbbf2aafa63012 100644 --- a/crates/ui2/src/components/language_selector.rs +++ b/crates/ui2/src/components/language_selector.rs @@ -46,10 +46,6 @@ mod stories { pub struct LanguageSelectorStory; impl LanguageSelectorStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, LanguageSelector>(cx)) diff --git a/crates/ui2/src/components/multi_buffer.rs b/crates/ui2/src/components/multi_buffer.rs index bbf893f8eff2955ab4354c90e4a874d91e987146..e5051fc5b81c05d3b77eb8c7d194d3580d70b6c0 100644 --- a/crates/ui2/src/components/multi_buffer.rs +++ b/crates/ui2/src/components/multi_buffer.rs @@ -48,10 +48,6 @@ mod stories { pub struct MultiBufferStory; impl MultiBufferStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let theme = theme(cx); diff --git a/crates/ui2/src/components/notifications_panel.rs b/crates/ui2/src/components/notifications_panel.rs index 3e0c3887c5a28e37d88063429ac69f40f2600eb6..68fe6d4bd0a98ea51717d7e2600feb043df70eab 100644 --- a/crates/ui2/src/components/notifications_panel.rs +++ b/crates/ui2/src/components/notifications_panel.rs @@ -56,10 +56,6 @@ mod stories { pub struct NotificationsPanelStory; impl NotificationsPanelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, NotificationsPanel>(cx)) diff --git a/crates/ui2/src/components/palette.rs b/crates/ui2/src/components/palette.rs index 97f3df0b7c808fca601a4f7e83e77ff63700940d..a74c9e367217b64cb509201ad43fe1bd4d3998d4 100644 --- a/crates/ui2/src/components/palette.rs +++ b/crates/ui2/src/components/palette.rs @@ -160,10 +160,6 @@ mod stories { pub struct PaletteStory; impl PaletteStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Palette>(cx)) diff --git a/crates/ui2/src/components/panel.rs b/crates/ui2/src/components/panel.rs index 7da2dab09a62ba1dd70c8b4d65b0b68c66fce592..40129dbd7613f5fa5efe1ae0fe9f3ce383a1ddfc 100644 --- a/crates/ui2/src/components/panel.rs +++ b/crates/ui2/src/components/panel.rs @@ -136,10 +136,6 @@ mod stories { pub struct PanelStory; impl PanelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Panel>(cx)) diff --git a/crates/ui2/src/components/project_panel.rs b/crates/ui2/src/components/project_panel.rs index 61458ad4a06168ca1b5ace400c0e92d491bb4ba2..9f15102acc876a83683a52b7f32d5d18fafc2979 100644 --- a/crates/ui2/src/components/project_panel.rs +++ b/crates/ui2/src/components/project_panel.rs @@ -65,10 +65,6 @@ mod stories { pub struct ProjectPanelStory; impl ProjectPanelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, ProjectPanel>(cx)) diff --git a/crates/ui2/src/components/recent_projects.rs b/crates/ui2/src/components/recent_projects.rs index 81da295c3a743c111cdd0c893bc038164b6d58d8..cd7c22eecb87530a0019190bf860656ec7370240 100644 --- a/crates/ui2/src/components/recent_projects.rs +++ b/crates/ui2/src/components/recent_projects.rs @@ -42,10 +42,6 @@ mod stories { pub struct RecentProjectsStory; impl RecentProjectsStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, RecentProjects>(cx)) diff --git a/crates/ui2/src/components/tab.rs b/crates/ui2/src/components/tab.rs index 45c57ae4842a813acf87d8017a934271c1531528..6133906f2723708949a0f088f55925ce2b94b2dc 100644 --- a/crates/ui2/src/components/tab.rs +++ b/crates/ui2/src/components/tab.rs @@ -176,10 +176,6 @@ mod stories { pub struct TabStory; impl TabStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let git_statuses = GitStatus::iter(); let fs_statuses = FileSystemStatus::iter(); diff --git a/crates/ui2/src/components/tab_bar.rs b/crates/ui2/src/components/tab_bar.rs index 4c27d85f03197ee8f20edb3c3bca50e49cc77408..cffdc09026cf3dff54e74e75c70165507253fc6d 100644 --- a/crates/ui2/src/components/tab_bar.rs +++ b/crates/ui2/src/components/tab_bar.rs @@ -100,10 +100,6 @@ mod stories { pub struct TabBarStory; impl TabBarStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, TabBar>(cx)) diff --git a/crates/ui2/src/components/terminal.rs b/crates/ui2/src/components/terminal.rs index 4a38d2052307a7f2692c5ecdd1573b836f3da294..b7c8c5d75d714abb2abd83f3f4c3996423a2ff71 100644 --- a/crates/ui2/src/components/terminal.rs +++ b/crates/ui2/src/components/terminal.rs @@ -91,10 +91,6 @@ mod stories { pub struct TerminalStory; impl TerminalStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Terminal>(cx)) diff --git a/crates/ui2/src/components/theme_selector.rs b/crates/ui2/src/components/theme_selector.rs index c1e1527d6c250679ccb194f3eb153ed578761824..b5fcd17d2fd065d2b2c7a0ae298354584a723413 100644 --- a/crates/ui2/src/components/theme_selector.rs +++ b/crates/ui2/src/components/theme_selector.rs @@ -47,10 +47,6 @@ mod stories { pub struct ThemeSelectorStory; impl ThemeSelectorStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, ThemeSelector>(cx)) diff --git a/crates/ui2/src/components/toast.rs b/crates/ui2/src/components/toast.rs index 626a79b36729533f8b7e31f0deea2cdf5a596d58..dca6f7c28ad2cfbc567edc2c0d9fd31245baf187 100644 --- a/crates/ui2/src/components/toast.rs +++ b/crates/ui2/src/components/toast.rs @@ -80,10 +80,6 @@ mod stories { pub struct ToastStory; impl ToastStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Toast>(cx)) diff --git a/crates/ui2/src/components/toolbar.rs b/crates/ui2/src/components/toolbar.rs index b9da93b55dc293fc6d1d1b348ad3e61af87edc44..a833090c1cc600277a69bfaf021b1d1da5c68e40 100644 --- a/crates/ui2/src/components/toolbar.rs +++ b/crates/ui2/src/components/toolbar.rs @@ -83,10 +83,6 @@ mod stories { pub struct ToolbarStory; impl ToolbarStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let theme = theme(cx); diff --git a/crates/ui2/src/components/traffic_lights.rs b/crates/ui2/src/components/traffic_lights.rs index f9bba2828a814717f91ff7d90fc0dc15fa8aabae..320e7e68fd52c4f691b6adf056c455b19d47b6eb 100644 --- a/crates/ui2/src/components/traffic_lights.rs +++ b/crates/ui2/src/components/traffic_lights.rs @@ -85,10 +85,6 @@ mod stories { pub struct TrafficLightsStory; impl TrafficLightsStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, TrafficLights>(cx)) diff --git a/crates/ui2/src/elements/avatar.rs b/crates/ui2/src/elements/avatar.rs index 3d540ec9ee29fd2624be11cd34af96fe35fc2422..87133209a27f666ea8766ba776edee3e95203566 100644 --- a/crates/ui2/src/elements/avatar.rs +++ b/crates/ui2/src/elements/avatar.rs @@ -51,10 +51,6 @@ mod stories { pub struct AvatarStory; impl AvatarStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Avatar>(cx)) diff --git a/crates/ui2/src/elements/button.rs b/crates/ui2/src/elements/button.rs index b54944b45b88f55dd3beb96918be89323b3a659e..15d65dc5d2240bc3dfdf88ea381de0024937691d 100644 --- a/crates/ui2/src/elements/button.rs +++ b/crates/ui2/src/elements/button.rs @@ -230,10 +230,6 @@ mod stories { pub struct ButtonStory; impl ButtonStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let states = InteractionState::iter(); diff --git a/crates/ui2/src/elements/details.rs b/crates/ui2/src/elements/details.rs index 2ff87670662c9901d4660aac7d22ba3f94db8b92..f89cfb53db4b91a510cff0d9af1a4c624ace7aa8 100644 --- a/crates/ui2/src/elements/details.rs +++ b/crates/ui2/src/elements/details.rs @@ -54,10 +54,6 @@ mod stories { pub struct DetailsStory; impl DetailsStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Details>(cx)) diff --git a/crates/ui2/src/elements/icon.rs b/crates/ui2/src/elements/icon.rs index 7816086a78c0a01e34160b8efb4c036797fdb038..b47e4c660852c609219ce8666c73a064a1ab7838 100644 --- a/crates/ui2/src/elements/icon.rs +++ b/crates/ui2/src/elements/icon.rs @@ -202,10 +202,6 @@ mod stories { pub struct IconStory; impl IconStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { let icons = Icon::iter(); diff --git a/crates/ui2/src/elements/input.rs b/crates/ui2/src/elements/input.rs index 557a8c5f83c6e8829c91024b1df319e31f0cfa68..79a09e0ba264aa8bb9b8869048d590f7e1839fd1 100644 --- a/crates/ui2/src/elements/input.rs +++ b/crates/ui2/src/elements/input.rs @@ -120,10 +120,6 @@ mod stories { pub struct InputStory; impl InputStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Input>(cx)) diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rs index 87076441ae3ff656706f3430c3824e12ff9d9864..f4014d5922db1e0aa644101362454b61508f0bcb 100644 --- a/crates/ui2/src/elements/label.rs +++ b/crates/ui2/src/elements/label.rs @@ -209,10 +209,6 @@ mod stories { pub struct LabelStory; impl LabelStory { - pub fn new() -> Self { - Self - } - fn render(self, _view: &mut V, cx: &mut ViewContext) -> impl Component { Story::container(cx) .child(Story::title_for::<_, Label>(cx))