Remove unneeded constructors for stories

This commit is contained in:
Marshall Bowers 2023-10-26 16:46:49 +02:00
parent 65045b9c52
commit 61694bba6a
33 changed files with 62 additions and 227 deletions

View file

@ -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<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, AssistantPanel>(cx))

View file

@ -83,10 +83,6 @@ mod stories {
pub struct BreadcrumbStory;
impl BreadcrumbStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(
self,
view_state: &mut V,

View file

@ -246,10 +246,6 @@ mod stories {
pub struct BufferStory;
impl BufferStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let theme = theme(cx);

View file

@ -117,10 +117,6 @@ mod stories {
pub struct ChatPanelStory;
impl ChatPanelStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, ChatPanel>(cx))

View file

@ -97,10 +97,6 @@ mod stories {
pub struct CollabPanelStory;
impl CollabPanelStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, CollabPanel>(cx))

View file

@ -35,10 +35,6 @@ mod stories {
pub struct CommandPaletteStory;
impl CommandPaletteStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, CommandPalette>(cx))

View file

@ -76,10 +76,6 @@ mod stories {
pub struct ContextMenuStory;
impl ContextMenuStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, ContextMenu>(cx))

View file

@ -33,10 +33,6 @@ mod stories {
pub struct CopilotModalStory;
impl CopilotModalStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, CopilotModal>(cx))

View file

@ -39,10 +39,6 @@ mod stories {
pub struct FacepileStory;
impl FacepileStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let players = static_players();

View file

@ -57,7 +57,10 @@ impl<V: 'static> IconButton<V> {
self
}
pub fn on_click(mut self, handler: impl 'static + Fn(&mut V, &mut ViewContext<V>) + Send + Sync) -> Self {
pub fn on_click(
mut self,
handler: impl 'static + Fn(&mut V, &mut ViewContext<V>) + Send + Sync,
) -> Self {
self.handlers.click = Some(Arc::new(handler));
self
}

View file

@ -168,10 +168,6 @@ mod stories {
pub struct KeybindingStory;
impl KeybindingStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let all_modifier_permutations = ModifierKey::iter().permutations(2);

View file

@ -46,10 +46,6 @@ mod stories {
pub struct LanguageSelectorStory;
impl LanguageSelectorStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, LanguageSelector>(cx))

View file

@ -48,10 +48,6 @@ mod stories {
pub struct MultiBufferStory;
impl MultiBufferStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let theme = theme(cx);

View file

@ -56,10 +56,6 @@ mod stories {
pub struct NotificationsPanelStory;
impl NotificationsPanelStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, NotificationsPanel>(cx))

View file

@ -160,10 +160,6 @@ mod stories {
pub struct PaletteStory;
impl PaletteStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, Palette>(cx))

View file

@ -136,10 +136,6 @@ mod stories {
pub struct PanelStory;
impl PanelStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, Panel<V>>(cx))

View file

@ -65,10 +65,6 @@ mod stories {
pub struct ProjectPanelStory;
impl ProjectPanelStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, ProjectPanel>(cx))

View file

@ -42,10 +42,6 @@ mod stories {
pub struct RecentProjectsStory;
impl RecentProjectsStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, RecentProjects>(cx))

View file

@ -176,10 +176,6 @@ mod stories {
pub struct TabStory;
impl TabStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let git_statuses = GitStatus::iter();
let fs_statuses = FileSystemStatus::iter();

View file

@ -100,10 +100,6 @@ mod stories {
pub struct TabBarStory;
impl TabBarStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, TabBar>(cx))

View file

@ -91,10 +91,6 @@ mod stories {
pub struct TerminalStory;
impl TerminalStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, Terminal>(cx))

View file

@ -47,10 +47,6 @@ mod stories {
pub struct ThemeSelectorStory;
impl ThemeSelectorStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, ThemeSelector>(cx))

View file

@ -80,10 +80,6 @@ mod stories {
pub struct ToastStory;
impl ToastStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, Toast<V>>(cx))

View file

@ -83,10 +83,6 @@ mod stories {
pub struct ToolbarStory;
impl ToolbarStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
let theme = theme(cx);

View file

@ -85,10 +85,6 @@ mod stories {
pub struct TrafficLightsStory;
impl TrafficLightsStory {
pub fn new() -> Self {
Self
}
fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
Story::container(cx)
.child(Story::title_for::<_, TrafficLights>(cx))