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) }