Allow spawning tasks with non-copy args.

This commit is contained in:
Dario Nieuwenhuis 2020-11-03 22:12:45 +01:00
parent 0a3590566d
commit b40e09d502

View File

@ -93,7 +93,7 @@ pub fn task(args: TokenStream, item: TokenStream) -> TokenStream {
#task_fn
type F = impl ::core::future::Future + 'static;
static POOL: [::embassy::executor::Task<F>; #pool_size] = [::embassy::executor::Task::new(); #pool_size];
unsafe { ::embassy::executor::Task::spawn(&POOL, || task(#arg_names)) }
unsafe { ::embassy::executor::Task::spawn(&POOL, move || task(#arg_names)) }
}
};
result.into()