aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy/src/executor/raw/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy/src/executor/raw/mod.rs b/embassy/src/executor/raw/mod.rs
index fb6a55611..5034c0d66 100644
--- a/embassy/src/executor/raw/mod.rs
+++ b/embassy/src/executor/raw/mod.rs
@@ -165,10 +165,10 @@ impl<F: Future + 'static> TaskStorage<F> {
165 /// on a different executor. 165 /// on a different executor.
166 pub fn spawn(&'static self, future: impl FnOnce() -> F) -> SpawnToken<impl Sized> { 166 pub fn spawn(&'static self, future: impl FnOnce() -> F) -> SpawnToken<impl Sized> {
167 if self.spawn_mark_used() { 167 if self.spawn_mark_used() {
168 unsafe { SpawnToken::<F>::new(self.spawn_initialize(future)) } 168 return unsafe { SpawnToken::<F>::new(self.spawn_initialize(future)) };
169 } else {
170 SpawnToken::<F>::new_failed()
171 } 169 }
170
171 SpawnToken::<F>::new_failed()
172 } 172 }
173 173
174 fn spawn_mark_used(&'static self) -> bool { 174 fn spawn_mark_used(&'static self) -> bool {