Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove some redundant entity clones (#36274)
Finn Evers3e0a75548620
diff --git a/crates/agent_ui/src/context_picker.rs b/crates/agent_ui/src/context_picker.rsindex 6c5546c6bbb..131023d2498 100644--- a/crates/agent_ui/src/context_picker.rs+++ b/crates/agent_ui/src/context_picker.rs@@ -228,7 +228,7 @@ impl ContextPicker {}fn build_menu(&mut self, window: &mut Window, cx: &mut Context<Self>) -> Entity<ContextMenu> {- let context_picker = cx.entity().clone();+ let context_picker = cx.entity();let menu = ContextMenu::build(window, cx, move |menu, _window, cx| {let recent = self.recent_entries(cx);diff --git a/crates/agent_ui/src/inline_assistant.rs b/crates/agent_ui/src/inline_assistant.rsindex 4a4a747899e..bbd35958059 100644--- a/crates/agent_ui/src/inline_assistant.rs+++ b/crates/agent_ui/src/inline_assistant.rs@@ -72,7 +72,7 @@ pub fn init(let Some(window) = window else {return;};- let workspace = cx.entity().clone();+ let workspace = cx.entity();InlineAssistant::update_global(cx, |inline_assistant, cx| {inline_assistant.register_workspace(&workspace, window, cx)});diff --git a/crates/agent_ui/src/profile_selector.rs b/crates/agent_ui/src/profile_selector.rsindex 27ca69590fb..ce25f531e25 100644--- a/crates/agent_ui/src/profile_selector.rs+++ b/crates/agent_ui/src/profile_selector.rs@@ -163,7 +163,7 @@ impl Render for ProfileSelector {.unwrap_or_else(|| "Unknown".into());if self.provider.profiles_supported(cx) {- let this = cx.entity().clone();+ let this = cx.entity();let focus_handle = self.focus_handle.clone();let trigger_button = Button::new("profile-selector-model", selected_profile).label_size(LabelSize::Small)diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rsindex 51d9f003f81..2bbaa8446c2 100644--- a/crates/collab_ui/src/chat_panel.rs+++ b/crates/collab_ui/src/chat_panel.rs@@ -674,7 +674,7 @@ impl ChatPanel {})}).when_some(message_id, |el, message_id| {- let this = cx.entity().clone();+ let this = cx.entity();el.child(self.render_popover_button(diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rsindex 430b447580e..c2cc6a7ad5c 100644--- a/crates/collab_ui/src/collab_panel.rs+++ b/crates/collab_ui/src/collab_panel.rs@@ -95,7 +95,7 @@ pub fn init(cx: &mut App) {.and_then(|room| room.read(cx).channel_id());if let Some(channel_id) = channel_id {- let workspace = cx.entity().clone();+ let workspace = cx.entity();window.defer(cx, move |window, cx| {ChannelView::open(channel_id, None, workspace, window, cx).detach_and_log_err(cx)@@ -1142,7 +1142,7 @@ impl CollabPanel {window: &mut Window,cx: &mut Context<Self>,) {- let this = cx.entity().clone();+ let this = cx.entity();if !(role == proto::ChannelRole::Guest|| role == proto::ChannelRole::Talker|| role == proto::ChannelRole::Member)@@ -1272,7 +1272,7 @@ impl CollabPanel {.channel_for_id(clipboard.channel_id).map(|channel| channel.name.clone())});- let this = cx.entity().clone();+ let this = cx.entity();let context_menu = ContextMenu::build(window, cx, |mut context_menu, window, cx| {if self.has_subchannels(ix) {@@ -1439,7 +1439,7 @@ impl CollabPanel {window: &mut Window,cx: &mut Context<Self>,) {- let this = cx.entity().clone();+ let this = cx.entity();let in_room = ActiveCall::global(cx).read(cx).room().is_some();let context_menu = ContextMenu::build(window, cx, |mut context_menu, _, _| {diff --git a/crates/collab_ui/src/collab_panel/channel_modal.rs b/crates/collab_ui/src/collab_panel/channel_modal.rsindex c0d3130ee99..e558835dbaf 100644--- a/crates/collab_ui/src/collab_panel/channel_modal.rs+++ b/crates/collab_ui/src/collab_panel/channel_modal.rs@@ -586,7 +586,7 @@ impl ChannelModalDelegate {return;};let user_id = membership.user.id;- let picker = cx.entity().clone();+ let picker = cx.entity();let context_menu = ContextMenu::build(window, cx, |mut menu, _window, _cx| {let role = membership.role;diff --git a/crates/collab_ui/src/notification_panel.rs b/crates/collab_ui/src/notification_panel.rsindex 3a280ff6677..a3420d603b0 100644--- a/crates/collab_ui/src/notification_panel.rs+++ b/crates/collab_ui/src/notification_panel.rs@@ -321,7 +321,7 @@ impl NotificationPanel {.justify_end().child(Button::new("decline", "Decline").on_click({let notification = notification.clone();- let entity = cx.entity().clone();+ let entity = cx.entity();move |_, _, cx| {entity.update(cx, |this, cx| {this.respond_to_notification(@@ -334,7 +334,7 @@ impl NotificationPanel {})).child(Button::new("accept", "Accept").on_click({let notification = notification.clone();- let entity = cx.entity().clone();+ let entity = cx.entity();move |_, _, cx| {entity.update(cx, |this, cx| {this.respond_to_notification(diff --git a/crates/debugger_ui/src/session/running.rs b/crates/debugger_ui/src/session/running.rsindex c8bee42039c..f3117aee079 100644--- a/crates/debugger_ui/src/session/running.rs+++ b/crates/debugger_ui/src/session/running.rs@@ -291,7 +291,7 @@ pub(crate) fn new_debugger_pane(let Some(project) = project.upgrade() else {return ControlFlow::Break(());};- let this_pane = cx.entity().clone();+ let this_pane = cx.entity();let item = if tab.pane == this_pane {pane.item_for_index(tab.ix)} else {@@ -502,7 +502,7 @@ pub(crate) fn new_debugger_pane(.on_drag(DraggedTab {item: item.boxed_clone(),- pane: cx.entity().clone(),+ pane: cx.entity(),detail: 0,is_active: selected,ix,diff --git a/crates/edit_prediction_button/src/edit_prediction_button.rs b/crates/edit_prediction_button/src/edit_prediction_button.rsindex 3d3b43d71bc..4632a03daf5 100644--- a/crates/edit_prediction_button/src/edit_prediction_button.rs+++ b/crates/edit_prediction_button/src/edit_prediction_button.rs@@ -127,7 +127,7 @@ impl Render for EditPredictionButton {}),);}- let this = cx.entity().clone();+ let this = cx.entity();div().child(PopoverMenu::new("copilot")@@ -182,7 +182,7 @@ impl Render for EditPredictionButton {let icon = status.to_icon();let tooltip_text = status.to_tooltip();let has_menu = status.has_menu();- let this = cx.entity().clone();+ let this = cx.entity();let fs = self.fs.clone();return div().child(@@ -331,7 +331,7 @@ impl Render for EditPredictionButton {})});- let this = cx.entity().clone();+ let this = cx.entity();let mut popover_menu = PopoverMenu::new("zeta").menu(move |window, cx| {diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rsindex cf9954bc12d..ef2bdc5da39 100644--- a/crates/editor/src/editor_tests.rs+++ b/crates/editor/src/editor_tests.rs@@ -74,7 +74,7 @@ fn test_edit_events(cx: &mut TestAppContext) {let editor1 = cx.add_window({let events = events.clone();|window, cx| {- let entity = cx.entity().clone();+ let entity = cx.entity();cx.subscribe_in(&entity,window,@@ -95,7 +95,7 @@ fn test_edit_events(cx: &mut TestAppContext) {let events = events.clone();|window, cx| {cx.subscribe_in(- &cx.entity().clone(),+ &cx.entity(),window,move |_, _, event: &EditorEvent, _, _| match event {EditorEvent::Edited { .. } => events.borrow_mut().push(("editor2", "edited")),@@ -19634,13 +19634,8 @@ fn test_crease_insertion_and_rendering(cx: &mut TestAppContext) {editor.insert_creases(Some(crease), cx);let snapshot = editor.snapshot(window, cx);- let _div = snapshot.render_crease_toggle(- MultiBufferRow(1),- false,- cx.entity().clone(),- window,- cx,- );+ let _div =+ snapshot.render_crease_toggle(MultiBufferRow(1), false, cx.entity(), window, cx);snapshot}).unwrap();diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 8a5c65f994f..5edfd7df309 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -7815,7 +7815,7 @@ impl Element for EditorElement {min_lines,max_lines,} => {- let editor_handle = cx.entity().clone();+ let editor_handle = cx.entity();let max_line_number_width =self.max_line_number_width(&editor.snapshot(window, cx), window);window.request_measured_layout(diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rsindex fe3e94f5c20..49159339205 100644--- a/crates/extensions_ui/src/extensions_ui.rs+++ b/crates/extensions_ui/src/extensions_ui.rs@@ -703,7 +703,7 @@ impl ExtensionsPage {extension: &ExtensionMetadata,cx: &mut Context<Self>,) -> ExtensionCard {- let this = cx.entity().clone();+ let this = cx.entity();let status = Self::extension_status(&extension.id, cx);let has_dev_extension = Self::dev_extension_exists(&extension.id, cx);diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rsindex de308b9dde5..70987dd2128 100644--- a/crates/git_ui/src/git_panel.rs+++ b/crates/git_ui/src/git_panel.rs@@ -3410,7 +3410,7 @@ impl GitPanel {* MAX_PANEL_EDITOR_LINES+ gap;- let git_panel = cx.entity().clone();+ let git_panel = cx.entity();let display_name = SharedString::from(Arc::from(active_repository.read(cx)diff --git a/crates/gpui/examples/input.rs b/crates/gpui/examples/input.rsindex 52a5b08b967..b0f560e38d4 100644--- a/crates/gpui/examples/input.rs+++ b/crates/gpui/examples/input.rs@@ -595,9 +595,7 @@ impl Render for TextInput {.w_full().p(px(4.)).bg(white())- .child(TextElement {- input: cx.entity().clone(),- }),+ .child(TextElement { input: cx.entity() }),)}}diff --git a/crates/language_tools/src/lsp_log.rs b/crates/language_tools/src/lsp_log.rsindex 606f3a3f0e5..823d59ce12e 100644--- a/crates/language_tools/src/lsp_log.rs+++ b/crates/language_tools/src/lsp_log.rs@@ -1358,7 +1358,7 @@ impl Render for LspLogToolbarItemView {}).collect();- let log_toolbar_view = cx.entity().clone();+ let log_toolbar_view = cx.entity();let lsp_menu = PopoverMenu::new("LspLogView").anchor(Corner::TopLeft)diff --git a/crates/language_tools/src/lsp_tool.rs b/crates/language_tools/src/lsp_tool.rsindex 50547253a92..3244350a34e 100644--- a/crates/language_tools/src/lsp_tool.rs+++ b/crates/language_tools/src/lsp_tool.rs@@ -1007,7 +1007,7 @@ impl Render for LspTool {(None, "All Servers Operational")};- let lsp_tool = cx.entity().clone();+ let lsp_tool = cx.entity();div().child(PopoverMenu::new("lsp-tool")diff --git a/crates/language_tools/src/syntax_tree_view.rs b/crates/language_tools/src/syntax_tree_view.rsindex eadba2c1d2f..9946442ec88 100644--- a/crates/language_tools/src/syntax_tree_view.rs+++ b/crates/language_tools/src/syntax_tree_view.rs@@ -456,7 +456,7 @@ impl SyntaxTreeToolbarItemView {let active_layer = buffer_state.active_layer.clone()?;let active_buffer = buffer_state.buffer.read(cx).snapshot();- let view = cx.entity().clone();+ let view = cx.entity();Some(PopoverMenu::new("Syntax Tree").trigger(Self::render_header(&active_layer))diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rsindex 1cda3897ec3..004a27b0cf0 100644--- a/crates/outline_panel/src/outline_panel.rs+++ b/crates/outline_panel/src/outline_panel.rs@@ -4815,51 +4815,45 @@ impl OutlinePanel {.when(show_indent_guides, |list| {list.with_decoration(ui::indent_guides(px(indent_size), IndentGuideColors::panel(cx))- .with_compute_indents_fn(- cx.entity().clone(),- |outline_panel, range, _, _| {- let entries = outline_panel.cached_entries.get(range);- if let Some(entries) = entries {- entries.into_iter().map(|item| item.depth).collect()- } else {- smallvec::SmallVec::new()- }- },- )- .with_render_fn(- cx.entity().clone(),- move |outline_panel, params, _, _| {- const LEFT_OFFSET: Pixels = px(14.);-- let indent_size = params.indent_size;- let item_height = params.item_height;- let active_indent_guide_ix = find_active_indent_guide_ix(- outline_panel,- ¶ms.indent_guides,- );+ .with_compute_indents_fn(cx.entity(), |outline_panel, range, _, _| {+ let entries = outline_panel.cached_entries.get(range);+ if let Some(entries) = entries {+ entries.into_iter().map(|item| item.depth).collect()+ } else {+ smallvec::SmallVec::new()+ }+ })+ .with_render_fn(cx.entity(), move |outline_panel, params, _, _| {+ const LEFT_OFFSET: Pixels = px(14.);++ let indent_size = params.indent_size;+ let item_height = params.item_height;+ let active_indent_guide_ix = find_active_indent_guide_ix(+ outline_panel,+ ¶ms.indent_guides,+ );- params- .indent_guides- .into_iter()- .enumerate()- .map(|(ix, layout)| {- let bounds = Bounds::new(- point(- layout.offset.x * indent_size + LEFT_OFFSET,- layout.offset.y * item_height,- ),- size(px(1.), layout.length * item_height),- );- ui::RenderedIndentGuide {- bounds,- layout,- is_active: active_indent_guide_ix == Some(ix),- hitbox: None,- }- })- .collect()- },- ),+ params+ .indent_guides+ .into_iter()+ .enumerate()+ .map(|(ix, layout)| {+ let bounds = Bounds::new(+ point(+ layout.offset.x * indent_size + LEFT_OFFSET,+ layout.offset.y * item_height,+ ),+ size(px(1.), layout.length * item_height),+ );+ ui::RenderedIndentGuide {+ bounds,+ layout,+ is_active: active_indent_guide_ix == Some(ix),+ hitbox: None,+ }+ })+ .collect()+ }),)})};diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rsindex 967df41e234..4d7f2faf62d 100644--- a/crates/project_panel/src/project_panel.rs+++ b/crates/project_panel/src/project_panel.rs@@ -5351,26 +5351,22 @@ impl Render for ProjectPanel {.when(show_indent_guides, |list| {list.with_decoration(ui::indent_guides(px(indent_size), IndentGuideColors::panel(cx))- .with_compute_indents_fn(- cx.entity().clone(),- |this, range, window, cx| {- let mut items =- SmallVec::with_capacity(range.end - range.start);- this.iter_visible_entries(- range,- window,- cx,- |entry, _, entries, _, _| {- let (depth, _) =- Self::calculate_depth_and_difference(- entry, entries,- );- items.push(depth);- },- );- items- },- )+ .with_compute_indents_fn(cx.entity(), |this, range, window, cx| {+ let mut items =+ SmallVec::with_capacity(range.end - range.start);+ this.iter_visible_entries(+ range,+ window,+ cx,+ |entry, _, entries, _, _| {+ let (depth, _) = Self::calculate_depth_and_difference(+ entry, entries,+ );+ items.push(depth);+ },+ );+ items+ }).on_click(cx.listener(|this, active_indent_guide: &IndentGuideLayout, window, cx| {if window.modifiers().secondary() {@@ -5394,7 +5390,7 @@ impl Render for ProjectPanel {}},))- .with_render_fn(cx.entity().clone(), move |this, params, _, cx| {+ .with_render_fn(cx.entity(), move |this, params, _, cx| {const LEFT_OFFSET: Pixels = px(14.);const PADDING_Y: Pixels = px(4.);const HITBOX_OVERDRAW: Pixels = px(3.);@@ -5447,7 +5443,7 @@ impl Render for ProjectPanel {}).when(show_sticky_entries, |list| {let sticky_items = ui::sticky_items(- cx.entity().clone(),+ cx.entity(),|this, range, window, cx| {let mut items = SmallVec::with_capacity(range.end - range.start);this.iter_visible_entries(@@ -5474,7 +5470,7 @@ impl Render for ProjectPanel {list.with_decoration(if show_indent_guides {sticky_items.with_decoration(ui::indent_guides(px(indent_size), IndentGuideColors::panel(cx))- .with_render_fn(cx.entity().clone(), move |_, params, _, _| {+ .with_render_fn(cx.entity(), move |_, params, _, _| {const LEFT_OFFSET: Pixels = px(14.);let indent_size = params.indent_size;diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rsindex 354434a7fc9..e5e166cb4cc 100644--- a/crates/recent_projects/src/remote_servers.rs+++ b/crates/recent_projects/src/remote_servers.rs@@ -1292,7 +1292,7 @@ impl RemoteServerProjects {let connection_string = connection_string.clone();move |_, _: &menu::Confirm, window, cx| {remove_ssh_server(- cx.entity().clone(),+ cx.entity(),server_index,connection_string.clone(),window,@@ -1312,7 +1312,7 @@ impl RemoteServerProjects {.child(Label::new("Remove Server").color(Color::Error)).on_click(cx.listener(move |_, _, window, cx| {remove_ssh_server(- cx.entity().clone(),+ cx.entity(),server_index,connection_string.clone(),window,diff --git a/crates/repl/src/session.rs b/crates/repl/src/session.rsindex 729a6161350..f945e5ed9f5 100644--- a/crates/repl/src/session.rs+++ b/crates/repl/src/session.rs@@ -244,7 +244,7 @@ impl Session {repl_session_id = cx.entity_id().to_string(),);- let session_view = cx.entity().clone();+ let session_view = cx.entity();let kernel = match self.kernel_specification.clone() {KernelSpecification::Jupyter(kernel_specification)diff --git a/crates/storybook/src/stories/indent_guides.rs b/crates/storybook/src/stories/indent_guides.rsindex e4f9669b1fd..db23ea79bd4 100644--- a/crates/storybook/src/stories/indent_guides.rs+++ b/crates/storybook/src/stories/indent_guides.rs@@ -65,7 +65,7 @@ impl Render for IndentGuidesStory {},).with_compute_indents_fn(- cx.entity().clone(),+ cx.entity(),|this, range, _cx, _context| {this.depths.iter()diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rsindex c9528c39b97..568dc1db2e8 100644--- a/crates/terminal_view/src/terminal_panel.rs+++ b/crates/terminal_view/src/terminal_panel.rs@@ -947,7 +947,7 @@ pub fn new_terminal_pane(cx: &mut Context<TerminalPanel>,) -> Entity<Pane> {let is_local = project.read(cx).is_local();- let terminal_panel = cx.entity().clone();+ let terminal_panel = cx.entity();let pane = cx.new(|cx| {let mut pane = Pane::new(workspace.clone(),@@ -1009,7 +1009,7 @@ pub fn new_terminal_pane(return ControlFlow::Break(());};if let Some(tab) = dropped_item.downcast_ref::<DraggedTab>() {- let this_pane = cx.entity().clone();+ let this_pane = cx.entity();let item = if tab.pane == this_pane {pane.item_for_index(tab.ix)} else {diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rsindex 219238496cb..534c0a80516 100644--- a/crates/terminal_view/src/terminal_view.rs+++ b/crates/terminal_view/src/terminal_view.rs@@ -1491,7 +1491,7 @@ impl TerminalView {impl Render for TerminalView {fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {let terminal_handle = self.terminal.clone();- let terminal_view_handle = cx.entity().clone();+ let terminal_view_handle = cx.entity();let focused = self.focus_handle.is_focused(window);diff --git a/crates/vim/src/mode_indicator.rs b/crates/vim/src/mode_indicator.rsindex d54b270074f..714b74f239c 100644--- a/crates/vim/src/mode_indicator.rs+++ b/crates/vim/src/mode_indicator.rs@@ -20,7 +20,7 @@ impl ModeIndicator {}).detach();- let handle = cx.entity().clone();+ let handle = cx.entity();let window_handle = window.window_handle();cx.observe_new::<Vim>(move |_, window, cx| {let Some(window) = window else {@@ -29,7 +29,7 @@ impl ModeIndicator {if window.window_handle() != window_handle {return;}- let vim = cx.entity().clone();+ let vim = cx.entity();handle.update(cx, |_, cx| {cx.subscribe(&vim, |mode_indicator, vim, event, cx| match event {VimEvent::Focused => {diff --git a/crates/vim/src/normal/search.rs b/crates/vim/src/normal/search.rsindex e4e95ca48ea..4054c552aeb 100644--- a/crates/vim/src/normal/search.rs+++ b/crates/vim/src/normal/search.rs@@ -332,7 +332,7 @@ impl Vim {Vim::take_forced_motion(cx);let prior_selections = self.editor_selections(window, cx);let cursor_word = self.editor_cursor_word(window, cx);- let vim = cx.entity().clone();+ let vim = cx.entity();let searched = pane.update(cx, |pane, cx| {self.search.direction = direction;diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rsindex 51bf2dd131c..44d9b8f4565 100644--- a/crates/vim/src/vim.rs+++ b/crates/vim/src/vim.rs@@ -402,7 +402,7 @@ impl Vim {const NAMESPACE: &'static str = "vim";pub fn new(window: &mut Window, cx: &mut Context<Editor>) -> Entity<Self> {- let editor = cx.entity().clone();+ let editor = cx.entity();let mut initial_mode = VimSettings::get_global(cx).default_mode;if initial_mode == Mode::Normal && HelixModeSetting::get_global(cx).0 {diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rsindex ca63d3e5532..ae72df39711 100644--- a/crates/workspace/src/dock.rs+++ b/crates/workspace/src/dock.rs@@ -253,7 +253,7 @@ impl Dock {cx: &mut Context<Workspace>,) -> Entity<Self> {let focus_handle = cx.focus_handle();- let workspace = cx.entity().clone();+ let workspace = cx.entity();let dock = cx.new(|cx| {let focus_subscription =cx.on_focus(&focus_handle, window, |dock: &mut Dock, window, cx| {diff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rsindex 7d8a28b0f1f..1356322a5c4 100644--- a/crates/workspace/src/notifications.rs+++ b/crates/workspace/src/notifications.rs@@ -346,7 +346,7 @@ impl Render for LanguageServerPrompt {).child(Label::new(request.message.to_string()).size(LabelSize::Small)).children(request.actions.iter().enumerate().map(|(ix, action)| {- let this_handle = cx.entity().clone();+ let this_handle = cx.entity();Button::new(ix, action.title.clone()).size(ButtonSize::Large).on_click(move |_, window, cx| {diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex 759e91f758c..860a57c21ff 100644--- a/crates/workspace/src/pane.rs+++ b/crates/workspace/src/pane.rs@@ -2198,7 +2198,7 @@ impl Pane {fn update_status_bar(&mut self, window: &mut Window, cx: &mut Context<Self>) {let workspace = self.workspace.clone();- let pane = cx.entity().clone();+ let pane = cx.entity();window.defer(cx, move |window, cx| {let Ok(status_bar) =@@ -2279,7 +2279,7 @@ impl Pane {cx: &mut Context<Self>,) {maybe!({- let pane = cx.entity().clone();+ let pane = cx.entity();let destination_index = match operation {PinOperation::Pin => self.pinned_tab_count.min(ix),@@ -2473,7 +2473,7 @@ impl Pane {.on_drag(DraggedTab {item: item.boxed_clone(),- pane: cx.entity().clone(),+ pane: cx.entity(),detail,is_active,ix,@@ -2832,7 +2832,7 @@ impl Pane {let navigate_backward = IconButton::new("navigate_backward", IconName::ArrowLeft).icon_size(IconSize::Small).on_click({- let entity = cx.entity().clone();+ let entity = cx.entity();move |_, window, cx| {entity.update(cx, |pane, cx| pane.navigate_backward(window, cx))}@@ -2848,7 +2848,7 @@ impl Pane {let navigate_forward = IconButton::new("navigate_forward", IconName::ArrowRight).icon_size(IconSize::Small).on_click({- let entity = cx.entity().clone();+ let entity = cx.entity();move |_, window, cx| entity.update(cx, |pane, cx| pane.navigate_forward(window, cx))}).disabled(!self.can_navigate_forward())@@ -3054,7 +3054,7 @@ impl Pane {return;}}- let mut to_pane = cx.entity().clone();+ let mut to_pane = cx.entity();let split_direction = self.drag_split_direction;let item_id = dragged_tab.item.item_id();if let Some(preview_item_id) = self.preview_item_id {@@ -3163,7 +3163,7 @@ impl Pane {return;}}- let mut to_pane = cx.entity().clone();+ let mut to_pane = cx.entity();let split_direction = self.drag_split_direction;let project_entry_id = *project_entry_id;self.workspace@@ -3239,7 +3239,7 @@ impl Pane {return;}}- let mut to_pane = cx.entity().clone();+ let mut to_pane = cx.entity();let mut split_direction = self.drag_split_direction;let paths = paths.paths().to_vec();let is_remote = selfdiff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex ade6838fad8..1eaa125ba5e 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -6338,7 +6338,7 @@ impl Render for Workspace {.border_b_1().border_color(colors.border).child({- let this = cx.entity().clone();+ let this = cx.entity();canvas(move |bounds, window, cx| {this.update(cx, |this, cx| {diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rsindex 84145a1be43..b06652b2ceb 100644--- a/crates/zed/src/zed.rs+++ b/crates/zed/src/zed.rs@@ -319,7 +319,7 @@ pub fn initialize_workspace(return;};- let workspace_handle = cx.entity().clone();+ let workspace_handle = cx.entity();let center_pane = workspace.active_pane().clone();initialize_pane(workspace, ¢er_pane, window, cx);