From 2e2a5f18e11019d3e384fee4ea7706e39356c556 Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Sat, 5 Mar 2022 17:01:51 -0600 Subject: [PATCH] Remove Send + 'static from all block_ons --- src/lib.rs | 4 +--- src/runtime.rs | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 18a77bc..15d0223 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,8 +9,6 @@ pub mod task; pub use task::{spawn, spawn_blocking}; -pub fn block_on( - future: impl std::future::Future + Send + 'static, -) -> T { +pub fn block_on(future: impl std::future::Future + Send + 'static) -> T { runtime::Runtime::new().block_on(future) } diff --git a/src/runtime.rs b/src/runtime.rs index 43669e5..daf5fe3 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -179,10 +179,7 @@ impl Runtime { &self.runtime_handle } - pub fn block_on( - &self, - future: impl Future + Send + 'static, - ) -> T { + pub fn block_on(&self, future: impl Future + Send + 'static) -> T { self.handle().block_on(future) }