diff --git a/zed/src/watch.rs b/zed/src/watch.rs index 9405338c983ba063efda257a801987d8a3783db3..33622edc6f69792fa5c2674cfd63750adf4f46fa 100644 --- a/zed/src/watch.rs +++ b/zed/src/watch.rs @@ -38,16 +38,18 @@ impl Receiver { impl Receiver { pub fn notify_model_on_change(&self, ctx: &mut ModelContext) { let watch = self.clone(); - let _ = ctx.spawn(async move { watch.updated().await }, |_, _, ctx| { + ctx.spawn(async move { watch.updated().await }, |_, _, ctx| { ctx.notify() - }); + }) + .detach(); } pub fn notify_view_on_change(&self, ctx: &mut ViewContext) { let watch = self.clone(); - let _ = ctx.spawn(async move { watch.updated().await }, |_, _, ctx| { + ctx.spawn(async move { watch.updated().await }, |_, _, ctx| { ctx.notify() - }); + }) + .detach(); } } diff --git a/zed/src/workspace/workspace.rs b/zed/src/workspace/workspace.rs index 617e22a2b11798788b48656481b73fe3313701b3..53c5088122ee6e3ac8fabb8be67377f133506a3f 100644 --- a/zed/src/workspace/workspace.rs +++ b/zed/src/workspace/workspace.rs @@ -161,29 +161,32 @@ impl Workspace { let (mut tx, rx) = watch::channel(None); self.items.insert(entry, OpenedItem::Loading(rx)); - let _ = ctx.spawn( + ctx.spawn( buffer, move |me, buffer: anyhow::Result, ctx| match buffer { Ok(buffer) => { let handle = Box::new(ctx.add_model(|_| buffer)) as Box; me.items.insert(entry, OpenedItem::Loaded(handle.clone())); - let _ = ctx.spawn( + ctx.spawn( async move { tx.update(|value| *value = Some(Ok(handle))).await; }, |_, _, _| {}, - ); + ) + .detach(); } Err(error) => { - let _ = ctx.spawn( + ctx.spawn( async move { tx.update(|value| *value = Some(Err(Arc::new(error)))).await; }, |_, _, _| {}, - ); + ) + .detach(); } }, - ); + ) + .detach(); self.open_entry(entry, ctx) } diff --git a/zed/src/workspace/workspace_view.rs b/zed/src/workspace/workspace_view.rs index feb58a39a766884c665116598cba752f783699e9..6456f920c443742975143f0c7e0a26379cf3f8fb 100644 --- a/zed/src/workspace/workspace_view.rs +++ b/zed/src/workspace/workspace_view.rs @@ -176,7 +176,7 @@ impl WorkspaceView { Err(error) => error!("{}", error), Ok(item) => { let settings = self.settings.clone(); - let _ = ctx.spawn(item, move |me, item, ctx| { + ctx.spawn(item, move |me, item, ctx| { me.loading_entries.remove(&entry); match item { Ok(item) => { @@ -187,7 +187,8 @@ impl WorkspaceView { error!("{}", error); } } - }); + }) + .detach(); } } }