@@ -8,7 +8,6 @@ use futures_util::stream::{FuturesUnordered, StreamExt};
88pub enum Callback {
99 EditorCompositor(Box<dyn FnOnce(&mut Editor, &mut Compositor) + Send>),
1010 Editor(Box<dyn FnOnce(&mut Editor) + Send>),
11− Compositor(Box<dyn FnOnce(&mut Compositor) + Send>),
1211}
1312
1413pub type JobFuture = BoxFuture<'static, anyhow::Result<Option<Callback>>>;
@@ -76,7 +75,6 @@ impl Jobs {
7675 Ok(Some(call)) => match call {
7776 Callback::EditorCompositor(call) => call(editor, compositor),
7877 Callback::Editor(call) => call(editor),
79− Callback::Compositor(call) => call(compositor),
8078 },
8179 Err(e) => {
8280 editor.set_error(format!("Async job failed: {}", e));
@@ -102,7 +100,7 @@ impl Jobs {
102100 /// Blocks until all the jobs that need to be waited on are done.
103101 pub async fn finish(
104102 &mut self,
105− mut editor: Option<&mut Editor>,
103+ editor: &mut Editor,
106104 mut compositor: Option<&mut Compositor>,
107105 ) -> anyhow::Result<()> {
108106 log::debug!("waiting on jobs...");
@@ -117,20 +115,10 @@ impl Jobs {
117115 // clippy doesn't realize this is an error without the derefs
118116 #[allow(clippy::needless_option_as_deref)]
119117 match callback {
120− Callback::EditorCompositor(call)
121− if editor.is_some() && compositor.is_some() =>
122− {
123− call(
124− editor.as_deref_mut().unwrap(),
125− compositor.as_deref_mut().unwrap(),
126− )
127− }
128− Callback::Editor(call) if editor.is_some() => {
129− call(editor.as_deref_mut().unwrap())
130− }
131− Callback::Compositor(call) if compositor.is_some() => {
132− call(compositor.as_deref_mut().unwrap())
118+ Callback::EditorCompositor(call) if compositor.is_some() => {
119+ call(editor, compositor.as_deref_mut().unwrap())
133120 }
121+ Callback::Editor(call) => call(editor),
134122
135123 // skip callbacks for which we don't have the necessary references
136124 _ => (),