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.

workspace: Remove excess clones (#35664)

tidelydd7fce3f5e3c
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 63953ff8027..6572574ce1a 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -1813,10 +1813,7 @@ impl Workspace {
.max_by(|b1, b2| b1.worktree_id.cmp(&b2.worktree_id))
});
- match latest_project_path_opened {
- Some(latest_project_path_opened) => latest_project_path_opened == history_path,
- None => true,
- }
+ latest_project_path_opened.map_or(true, |path| path == history_path)
})
}
@@ -4796,7 +4793,7 @@ impl Workspace {
.remote_id(&self.app_state.client, window, cx)
.map(|id| id.to_proto());
- if let Some(id) = id.clone() {
+ if let Some(id) = id {
if let Some(variant) = item.to_state_proto(window, cx) {
let view = Some(proto::View {
id: id.clone(),
@@ -4809,7 +4806,7 @@ impl Workspace {
update = proto::UpdateActiveView {
view,
// TODO: Remove after version 0.145.x stabilizes.
- id: id.clone(),
+ id,
leader_id: leader_peer_id,
};
}