aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2020-11-03 22:12:45 +0100
committerDario Nieuwenhuis <[email protected]>2020-11-03 22:12:45 +0100
commitb40e09d502208b8c9fe2d35c63065bb82417ff89 (patch)
treeae9651a5fea54ac06e3cf3ee9f1b0dc0fd9fbe55
parent0a3590566d839fc32963d4756d99aa79917a1934 (diff)
Allow spawning tasks with non-copy args.
-rw-r--r--embassy-macros/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-macros/src/lib.rs b/embassy-macros/src/lib.rs
index db4afcb9b..b11fc4ae9 100644
--- a/embassy-macros/src/lib.rs
+++ b/embassy-macros/src/lib.rs
@@ -93,7 +93,7 @@ pub fn task(args: TokenStream, item: TokenStream) -> TokenStream {
93 #task_fn 93 #task_fn
94 type F = impl ::core::future::Future + 'static; 94 type F = impl ::core::future::Future + 'static;
95 static POOL: [::embassy::executor::Task<F>; #pool_size] = [::embassy::executor::Task::new(); #pool_size]; 95 static POOL: [::embassy::executor::Task<F>; #pool_size] = [::embassy::executor::Task::new(); #pool_size];
96 unsafe { ::embassy::executor::Task::spawn(&POOL, || task(#arg_names)) } 96 unsafe { ::embassy::executor::Task::spawn(&POOL, move || task(#arg_names)) }
97 } 97 }
98 }; 98 };
99 result.into() 99 result.into()