Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove more unneeded `Clone` bounds
Marshall Bowersc831c5749a9f
diff --git a/crates/ui2/src/components/assistant_panel.rs b/crates/ui2/src/components/assistant_panel.rsindex adf786e09aa..2b32f332a48 100644--- a/crates/ui2/src/components/assistant_panel.rs+++ b/crates/ui2/src/components/assistant_panel.rs@@ -6,13 +6,13 @@ use crate::prelude::*;use crate::{Icon, IconButton, Label, Panel, PanelSide};#[derive(Element)]-pub struct AssistantPanel<S: 'static + Send + Sync + Clone> {+pub struct AssistantPanel<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,current_side: PanelSide,}-impl<S: 'static + Send + Sync + Clone> AssistantPanel<S> {+impl<S: 'static + Send + Sync> AssistantPanel<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),@@ -87,11 +87,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct AssistantPanelStory<S: 'static + Send + Sync + Clone> {+ pub struct AssistantPanelStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> AssistantPanelStory<S> {+ impl<S: 'static + Send + Sync> AssistantPanelStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/breadcrumb.rs b/crates/ui2/src/components/breadcrumb.rsindex d0286f325db..23dc824006b 100644--- a/crates/ui2/src/components/breadcrumb.rs+++ b/crates/ui2/src/components/breadcrumb.rs@@ -10,13 +10,13 @@ use crate::{h_stack, HighlightedText};pub struct Symbol(pub Vec<HighlightedText>);#[derive(Element)]-pub struct Breadcrumb<S: 'static + Send + Sync + Clone> {+pub struct Breadcrumb<S: 'static + Send + Sync> {state_type: PhantomData<S>,path: PathBuf,symbols: Vec<Symbol>,}-impl<S: 'static + Send + Sync + Clone> Breadcrumb<S> {+impl<S: 'static + Send + Sync> Breadcrumb<S> {pub fn new(path: PathBuf, symbols: Vec<Symbol>) -> Self {Self {state_type: PhantomData,@@ -91,11 +91,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct BreadcrumbStory<S: 'static + Send + Sync + Clone> {+ pub struct BreadcrumbStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> BreadcrumbStory<S> {+ impl<S: 'static + Send + Sync> BreadcrumbStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/chat_panel.rs b/crates/ui2/src/components/chat_panel.rsindex 6eb534abe95..e8f535bda9e 100644--- a/crates/ui2/src/components/chat_panel.rs+++ b/crates/ui2/src/components/chat_panel.rs@@ -118,11 +118,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct ChatPanelStory<S: 'static + Send + Sync + Clone> {+ pub struct ChatPanelStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> ChatPanelStory<S> {+ impl<S: 'static + Send + Sync> ChatPanelStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/collab_panel.rs b/crates/ui2/src/components/collab_panel.rsindex b5aff7926cc..b88697656df 100644--- a/crates/ui2/src/components/collab_panel.rs+++ b/crates/ui2/src/components/collab_panel.rs@@ -7,12 +7,12 @@ use gpui3::{img, svg, SharedString};use std::marker::PhantomData;#[derive(Element)]-pub struct CollabPanel<S: 'static + Send + Sync + Clone> {+pub struct CollabPanel<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,}-impl<S: 'static + Send + Sync + Clone> CollabPanel<S> {+impl<S: 'static + Send + Sync> CollabPanel<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),@@ -165,11 +165,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct CollabPanelStory<S: 'static + Send + Sync + Clone> {+ pub struct CollabPanelStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> CollabPanelStory<S> {+ impl<S: 'static + Send + Sync> CollabPanelStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/command_palette.rs b/crates/ui2/src/components/command_palette.rsindex 11d80fdc864..45194e843c7 100644--- a/crates/ui2/src/components/command_palette.rs+++ b/crates/ui2/src/components/command_palette.rs@@ -4,12 +4,12 @@ use crate::prelude::*;use crate::{example_editor_actions, OrderMethod, Palette};#[derive(Element)]-pub struct CommandPalette<S: 'static + Send + Sync + Clone> {+pub struct CommandPalette<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,}-impl<S: 'static + Send + Sync + Clone> CommandPalette<S> {+impl<S: 'static + Send + Sync> CommandPalette<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),@@ -38,11 +38,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct CommandPaletteStory<S: 'static + Send + Sync + Clone> {+ pub struct CommandPaletteStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> CommandPaletteStory<S> {+ impl<S: 'static + Send + Sync> CommandPaletteStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rsindex 5096f37c6d7..aa07f9a5804 100644--- a/crates/ui2/src/components/context_menu.rs+++ b/crates/ui2/src/components/context_menu.rs@@ -74,11 +74,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct ContextMenuStory<S: 'static + Send + Sync + Clone> {+ pub struct ContextMenuStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> ContextMenuStory<S> {+ impl<S: 'static + Send + Sync> ContextMenuStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/components/notifications_panel.rs b/crates/ui2/src/components/notifications_panel.rsindex f60bfb45859..467928ff43e 100644--- a/crates/ui2/src/components/notifications_panel.rs+++ b/crates/ui2/src/components/notifications_panel.rs@@ -4,12 +4,12 @@ use crate::{prelude::*, static_new_notification_items, static_read_notification_use crate::{List, ListHeader};#[derive(Element)]-pub struct NotificationsPanel<S: 'static + Send + Sync + Clone> {+pub struct NotificationsPanel<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,}-impl<S: 'static + Send + Sync + Clone> NotificationsPanel<S> {+impl<S: 'static + Send + Sync> NotificationsPanel<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),diff --git a/crates/ui2/src/components/project_panel.rs b/crates/ui2/src/components/project_panel.rsindex d1b89f9b4ca..29008ea30fb 100644--- a/crates/ui2/src/components/project_panel.rs+++ b/crates/ui2/src/components/project_panel.rs@@ -6,12 +6,12 @@ use crate::{};#[derive(Element)]-pub struct ProjectPanel<S: 'static + Send + Sync + Clone> {+pub struct ProjectPanel<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,}-impl<S: 'static + Send + Sync + Clone> ProjectPanel<S> {+impl<S: 'static + Send + Sync> ProjectPanel<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),diff --git a/crates/ui2/src/components/theme_selector.rs b/crates/ui2/src/components/theme_selector.rsindex 99a0119facd..3186e814bdc 100644--- a/crates/ui2/src/components/theme_selector.rs+++ b/crates/ui2/src/components/theme_selector.rs@@ -4,12 +4,12 @@ use crate::prelude::*;use crate::{OrderMethod, Palette, PaletteItem};#[derive(Element)]-pub struct ThemeSelector<S: 'static + Send + Sync + Clone> {+pub struct ThemeSelector<S: 'static + Send + Sync> {id: ElementId,state_type: PhantomData<S>,}-impl<S: 'static + Send + Sync + Clone> ThemeSelector<S> {+impl<S: 'static + Send + Sync> ThemeSelector<S> {pub fn new(id: impl Into<ElementId>) -> Self {Self {id: id.into(),diff --git a/crates/ui2/src/components/toast.rs b/crates/ui2/src/components/toast.rsindex 1f19dc911ef..66bd40f4233 100644--- a/crates/ui2/src/components/toast.rs+++ b/crates/ui2/src/components/toast.rs@@ -79,11 +79,11 @@ mod stories {use super::*;#[derive(Element)]- pub struct ToastStory<S: 'static + Send + Sync + Clone> {+ pub struct ToastStory<S: 'static + Send + Sync> {state_type: PhantomData<S>,}- impl<S: 'static + Send + Sync + Clone> ToastStory<S> {+ impl<S: 'static + Send + Sync> ToastStory<S> {pub fn new() -> Self {Self {state_type: PhantomData,diff --git a/crates/ui2/src/static_data.rs b/crates/ui2/src/static_data.rsindex d62fed09a09..06473fbfa42 100644--- a/crates/ui2/src/static_data.rs+++ b/crates/ui2/src/static_data.rs@@ -324,7 +324,7 @@ pub fn static_players_with_call_status() -> Vec<PlayerWithCallStatus> {]}-pub fn static_new_notification_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_new_notification_items<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListDetailsEntry::new("maxdeviant invited you to join a stream in #design.").meta("4 people in stream."),@@ -335,7 +335,7 @@ pub fn static_new_notification_items<S: 'static + Send + Sync + Clone>() -> Vec<.collect()}-pub fn static_read_notification_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_read_notification_items<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListDetailsEntry::new("mikaylamaki added you as a contact.").actions(vec![Button::new("Decline"),@@ -351,7 +351,7 @@ pub fn static_read_notification_items<S: 'static + Send + Sync + Clone>() -> Vec.collect()}-pub fn static_project_panel_project_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_project_panel_project_items<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListEntry::new(Label::new("zed")).set_left_icon(Icon::FolderOpen.into())@@ -478,7 +478,7 @@ pub fn static_project_panel_project_items<S: 'static + Send + Sync + Clone>() ->.collect()}-pub fn static_project_panel_single_items<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_project_panel_single_items<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListEntry::new(Label::new("todo.md")).set_left_icon(Icon::FileDoc.into())@@ -495,7 +495,7 @@ pub fn static_project_panel_single_items<S: 'static + Send + Sync + Clone>() ->.collect()}-pub fn static_collab_panel_current_call<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_collab_panel_current_call<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListEntry::new(Label::new("as-cii")).set_left_avatar("http://github.com/as-cii.png?s=50"),ListEntry::new(Label::new("nathansobo"))@@ -508,7 +508,7 @@ pub fn static_collab_panel_current_call<S: 'static + Send + Sync + Clone>() -> V.collect()}-pub fn static_collab_panel_channels<S: 'static + Send + Sync + Clone>() -> Vec<ListItem<S>> {+pub fn static_collab_panel_channels<S: 'static + Send + Sync>() -> Vec<ListItem<S>> {vec![ListEntry::new(Label::new("zed")).set_left_icon(Icon::Hash.into())@@ -572,7 +572,7 @@ pub fn static_collab_panel_channels<S: 'static + Send + Sync + Clone>() -> Vec<L.collect()}-pub fn example_editor_actions<S: 'static + Send + Sync + Clone>() -> Vec<PaletteItem<S>> {+pub fn example_editor_actions<S: 'static + Send + Sync>() -> Vec<PaletteItem<S>> {vec![PaletteItem::new("New File").keybinding(Keybinding::new("N".to_string(),