Remove more unneeded Clone bounds

This commit is contained in:
Marshall Bowers 2023-10-20 11:32:10 -04:00
parent 901af8de3f
commit c831c5749a
11 changed files with 35 additions and 35 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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(),

View file

@ -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(),

View file

@ -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(),

View file

@ -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,

View file

@ -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(),