From d71c4b45516f109a70a7ab6e1d728b3039c5d165 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 3 Feb 2021 04:41:46 +0100 Subject: [PATCH] Make spawners Copy+Clone --- embassy/src/executor/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/embassy/src/executor/mod.rs b/embassy/src/executor/mod.rs index 6e4bded0..3ba0cea6 100644 --- a/embassy/src/executor/mod.rs +++ b/embassy/src/executor/mod.rs @@ -107,6 +107,7 @@ pub enum SpawnError { /// only be used in the executor thread (it is not Send itself). /// /// If you want to spawn tasks from another thread, use [SendSpawner]. +#[derive(Copy, Clone)] pub struct Spawner { executor: &'static raw::Executor, not_send: PhantomData<*mut ()>, @@ -143,6 +144,7 @@ impl Spawner { /// only be used in the executor thread (it is not Send itself). /// /// If you want to spawn tasks from another thread, use [SendSpawner]. +#[derive(Copy, Clone)] pub struct SendSpawner { executor: &'static raw::Executor, not_send: PhantomData<*mut ()>,