remove typed stuff / just specify rsc if needed
This commit is contained in:
@@ -62,17 +62,14 @@ impl<Rsc: HasState> Tasks<Rsc> {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn spawn<F: for<'a> AsyncFnOnce(&'a mut TaskCtx<Rsc>) + 'static + std::marker::Send>(
|
||||
&mut self,
|
||||
task: F,
|
||||
) where
|
||||
for<'a> <F as AsyncFnOnce<(&'a mut TaskCtx<Rsc>,)>>::CallOnceFuture: Send,
|
||||
pub fn spawn<F: AsyncFnOnce(TaskCtx<Rsc>) + 'static + std::marker::Send>(&mut self, task: F)
|
||||
where
|
||||
F::CallOnceFuture: Send,
|
||||
{
|
||||
let send = self.msg_send.clone();
|
||||
let window = self.window.clone();
|
||||
let _ = self.start.send(Box::pin(async move {
|
||||
let mut ctx = TaskCtx::new(send);
|
||||
task(&mut ctx).await;
|
||||
task(TaskCtx::new(send)).await;
|
||||
window.request_redraw();
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user