From 1e8060a5a28edcb615f50733aab982fc85d0ece6 Mon Sep 17 00:00:00 2001 From: Alec Deason Date: Tue, 19 Jan 2021 13:07:45 -0800 Subject: [PATCH] Add missing spawn_local method to Scope in the single threaded executor case (#1266) --- crates/bevy_tasks/src/single_threaded_task_pool.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_tasks/src/single_threaded_task_pool.rs b/crates/bevy_tasks/src/single_threaded_task_pool.rs index 89137cb141..8f248e1005 100644 --- a/crates/bevy_tasks/src/single_threaded_task_pool.rs +++ b/crates/bevy_tasks/src/single_threaded_task_pool.rs @@ -127,6 +127,10 @@ pub struct Scope<'scope, T> { impl<'scope, T: Send + 'scope> Scope<'scope, T> { pub fn spawn + 'scope + Send>(&mut self, f: Fut) { + self.spawn_local(f); + } + + pub fn spawn_local + 'scope>(&mut self, f: Fut) { let result = Arc::new(Mutex::new(None)); self.results.push(result.clone()); let f = async move {