Remove unneeded constructors for stories
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user