diff options
author | Gurwinder Singh <vargwin@gmail.com> | 2020-01-01 20:21:27 +0530 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-01 09:51:27 -0500 |
commit | 55add2d366c5b3e19bd91958f3e3a36b4439839d (patch) | |
tree | 35c68bbc6140ea99c9deebe12c0fb1abc85ae2e8 /cli/tokio_util.rs | |
parent | 4258ed262f6eed9b0ee123e1ba9c91f999f0b429 (diff) |
cleanup after tokio upgrade (#3571)
tokio_util::run and tokio::run_on_current_thread should accept Future<Output=()> instead of Future<Output=Result<(), ()>>. Currently, all the passed futures have to add Ok(()) or futures::future::ok(()) unnecessarily to call this method.
Diffstat (limited to 'cli/tokio_util.rs')
-rw-r--r-- | cli/tokio_util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs index ec1e0e3cf..0b8f60152 100644 --- a/cli/tokio_util.rs +++ b/cli/tokio_util.rs @@ -5,7 +5,7 @@ use tokio::runtime; pub fn run<F>(future: F) where - F: Future<Output = Result<(), ()>> + Send + 'static, + F: Future<Output = ()> + Send + 'static, { let mut rt = runtime::Builder::new() .threaded_scheduler() @@ -13,12 +13,12 @@ where .thread_name("deno") .build() .expect("Unable to create Tokio runtime"); - rt.block_on(future).unwrap(); + rt.block_on(future); } pub fn run_on_current_thread<F>(future: F) where - F: Future<Output = Result<(), ()>> + Send + 'static, + F: Future<Output = ()> + Send + 'static, { let mut rt = runtime::Builder::new() .basic_scheduler() @@ -26,5 +26,5 @@ where .thread_name("deno") .build() .expect("Unable to create Tokio runtime"); - rt.block_on(future).unwrap(); + rt.block_on(future); } |