From d8cc9fc54c191fe611c77be08debc6b7e3f81d8c Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 14 Oct 2023 01:44:37 +0000 Subject: [PATCH] Use regular tokio::task::spawn in native context --- src/compat.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compat.rs b/src/compat.rs index 39adea0..0307270 100644 --- a/src/compat.rs +++ b/src/compat.rs @@ -2,13 +2,12 @@ use std::time::Duration; use tokio::task::JoinHandle; use futures_util::Future; -#[cfg(not(target_arch = "wasm32"))] pub fn spawn(future: F) -> Option> where - F: Future + 'static, - F::Output: 'static + F: Future + Send + 'static, + F::Output: Send + 'static, { - Some(tokio::task::spawn_local(future)) + Some(tokio::task::spawn(future)) } #[cfg(target_arch = "wasm32")]