Remove some redundant entity clones (#36274)

`cx.entity()` already returns an owned entity, so there is no need for
these clones.

Release Notes:

- N/A
This commit is contained in:
Finn Evers 2025-08-15 22:27:44 +02:00 committed by GitHub
parent 7199c733b2
commit 3e0a755486
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 106 additions and 123 deletions

View file

@ -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 = self