diff --git a/src/tools/runtime.rs b/src/tools/runtime.rs index 92155f05..ed7bd7ed 100644 --- a/src/tools/runtime.rs +++ b/src/tools/runtime.rs @@ -76,12 +76,7 @@ pub fn block_in_place(fut: impl FnOnce() -> R) -> R { } /// Block on a future in this thread. -pub fn block_on(fut: F) -> R -where - R: Send + 'static, - F: Future + Send, -{ - +pub fn block_on(fut: F) -> F::Output { if is_in_tokio() { // inside a tokio worker we need to tell tokio that we're about to really block: tokio::task::block_in_place(move || futures::executor::block_on(fut)) @@ -122,10 +117,6 @@ where /// This used to be our tokio main entry point. Now this just calls out to `block_on` for /// compatibility, which will perform all the necessary tasks on-demand anyway. -pub fn main(fut: F) -> F::Output -where - F: Future + Send, - F::Output: Send + 'static, -{ +pub fn main(fut: F) -> F::Output { block_on(fut) }