From 650e05229908acb4e62608d2a150182a871579d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 20 Jan 2020 14:09:24 +0100 Subject: [PATCH] runtime: drop now not required Send and static restrictions Signed-off-by: Wolfgang Bumiller --- src/tools/runtime.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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) }