Remove delegate support from GPUI

We added this because we thought it would save some allocations when
sending operations given that we could move them to the delegate upon
notifying it, but the reality is that we serialize operations and that
only requires a reference.
This commit is contained in:
Antonio Scandurra 2022-03-09 10:48:52 +01:00
parent 0a9595b5fa
commit ef1ec88523
3 changed files with 10 additions and 124 deletions

View file

@ -942,7 +942,7 @@ impl Project {
remote_id
))?,
}
cx.become_delegate(buffer, |this, buffer, event, cx| {
cx.subscribe(buffer, |this, buffer, event, cx| {
this.on_buffer_event(buffer, event, cx);
})
.detach();
@ -1028,7 +1028,7 @@ impl Project {
fn on_buffer_event(
&mut self,
buffer: ModelHandle<Buffer>,
event: BufferEvent,
event: &BufferEvent,
cx: &mut ModelContext<Self>,
) -> Option<()> {
match event {