Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't capture `Workspace` handle in `defer` when rendering `Dock`

Antonio Scandurraeee39b4c5c16
diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs
index 788ea2ff644..0f13bc1a044 100644
--- a/crates/workspace/src/dock.rs
+++ b/crates/workspace/src/dock.rs
@@ -362,13 +362,8 @@ impl Dock {
);
let size = resizable.current_size();
- let workspace = cx.handle().downgrade();
- cx.defer(move |_, cx| {
- if let Some(workspace) = workspace.upgrade(cx) {
- workspace.update(cx, |workspace, _| {
- workspace.dock.panel_sizes.insert(anchor, size);
- })
- }
+ cx.defer(move |workspace, _| {
+ workspace.dock.panel_sizes.insert(anchor, size);
});
if anchor == DockAnchor::Right {