diff options
author | Gurwinder Singh <vargwin@gmail.com> | 2020-01-04 15:50:52 +0530 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-04 05:20:52 -0500 |
commit | 9f6bab6010abb26814d6d7a163db24fa5965d09c (patch) | |
tree | d680722aeffb6535de0f49689a4dbf8763836b2c /cli/ops/process.rs | |
parent | 70b1be6ff459ebd2bf57b7788ab7d66c1f375b29 (diff) |
Use async at places, use &self instead of self: &Self (#3594)
Diffstat (limited to 'cli/ops/process.rs')
-rw-r--r-- | cli/ops/process.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/ops/process.rs b/cli/ops/process.rs index 92474cc4f..80ce4b1ac 100644 --- a/cli/ops/process.rs +++ b/cli/ops/process.rs @@ -220,7 +220,8 @@ fn op_run_status( state: state.clone(), }; - let future = future.and_then(move |run_status| { + let future = async move { + let run_status = future.await?; let code = run_status.code(); #[cfg(unix)] @@ -233,12 +234,12 @@ fn op_run_status( .expect("Should have either an exit code or a signal."); let got_signal = signal.is_some(); - futures::future::ok(json!({ + Ok(json!({ "gotSignal": got_signal, "exitCode": code.unwrap_or(-1), "exitSignal": signal.unwrap_or(-1), })) - }); + }; let pool = futures::executor::ThreadPool::new().unwrap(); let handle = pool.spawn_with_handle(future).unwrap(); |