diff options
author | gurv-s <vargwin@gmail.com> | 2019-06-08 16:40:12 +0530 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-08 10:59:20 -0400 |
commit | 35f879ad32bc7fddb1c20e9a4154f42c7b9b8350 (patch) | |
tree | 4946e49a5835bad88072b136fbfec44fc86a19e9 /cli/compiler.rs | |
parent | 95eac608a6e9793307d6f19a546a2a980542b839 (diff) |
Remove tokio_util::block_on dep in compile_async and other cleanup
Diffstat (limited to 'cli/compiler.rs')
-rw-r--r-- | cli/compiler.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/compiler.rs b/cli/compiler.rs index b299f0a4c..3a036a627 100644 --- a/cli/compiler.rs +++ b/cli/compiler.rs @@ -142,11 +142,18 @@ pub fn compile_async( } } - let r = state - .dir - .fetch_module_meta_data(&module_name, ".", true, true); - let module_meta_data_after_compile = r.unwrap(); - + Ok(()) + }).and_then(move |_| { + state.dir.fetch_module_meta_data_async( + &module_name, + ".", + true, + true, + ).map_err(|e| { + // TODO(95th) Instead of panicking, We could translate this error to Diagnostic. + panic!("{}", e) + }) + }).and_then(move |module_meta_data_after_compile| { // Explicit drop to keep reference alive until future completes. drop(compiling_job); |