Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
project: Remove unused BufferOpened event (#49775)
Xiaobo Liu5205e54d7e8c
diff --git a/crates/project/src/buffer_store.rs b/crates/project/src/buffer_store.rsindex 8b65caca7e2..9faf80b7ac0 100644--- a/crates/project/src/buffer_store.rs+++ b/crates/project/src/buffer_store.rs@@ -86,11 +86,6 @@ enum OpenBuffer {pub enum BufferStoreEvent {BufferAdded(Entity<Buffer>),- // TODO(jk): this event seems unused- BufferOpened {- buffer: Entity<Buffer>,- project_path: ProjectPath,- },SharedBufferClosed(proto::PeerId, BufferId),BufferDropped(BufferId),BufferChangedFilePath {@@ -853,11 +848,6 @@ impl BufferStore {cx: &mut Context<Self>,) -> Task<Result<Entity<Buffer>>> {if let Some(buffer) = self.get_by_path(&project_path) {- cx.emit(BufferStoreEvent::BufferOpened {- buffer: buffer.clone(),- project_path,- });-return Task::ready(Ok(buffer));}@@ -882,16 +872,11 @@ impl BufferStore {// todo(lw): hot foreground spawncx.spawn(async move |this, cx| {let load_result = load_buffer.await;- this.update(cx, |this, cx| {+ this.update(cx, |this, _cx| {// Record the fact that the buffer is no longer loading.this.loading_buffers.remove(&project_path);let buffer = load_result.map_err(Arc::new)?;- cx.emit(BufferStoreEvent::BufferOpened {- buffer: buffer.clone(),- project_path,- });-Ok(buffer)})?})diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rsindex 70b29635d59..b9d6f72d532 100644--- a/crates/project/src/git_store.rs+++ b/crates/project/src/git_store.rs@@ -1615,7 +1615,6 @@ impl GitStore {.detach();}}- _ => {}}}