diff options
Diffstat (limited to 'cli/compilers/wasm.rs')
-rw-r--r-- | cli/compilers/wasm.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/compilers/wasm.rs b/cli/compilers/wasm.rs index e0a715f84..30a171db4 100644 --- a/cli/compilers/wasm.rs +++ b/cli/compilers/wasm.rs @@ -7,11 +7,12 @@ use crate::startup_data; use crate::state::*; use crate::worker::Worker; use deno::Buf; -use futures::Future; -use futures::IntoFuture; +use futures::FutureExt; +use futures::TryFutureExt; use serde_derive::Deserialize; use serde_json; use std::collections::HashMap; +use std::pin::Pin; use std::sync::atomic::Ordering; use std::sync::{Arc, Mutex}; use url::Url; @@ -71,11 +72,11 @@ impl WasmCompiler { self: &Self, global_state: ThreadSafeGlobalState, source_file: &SourceFile, - ) -> Box<CompiledModuleFuture> { + ) -> Pin<Box<CompiledModuleFuture>> { let cache = self.cache.clone(); let maybe_cached = { cache.lock().unwrap().get(&source_file.url).cloned() }; if let Some(m) = maybe_cached { - return Box::new(futures::future::ok(m.clone())); + return futures::future::ok(m.clone()).boxed(); } let cache_ = self.cache.clone(); @@ -92,7 +93,6 @@ impl WasmCompiler { .into_boxed_str() .into_boxed_bytes(), ) - .into_future() .then(move |_| worker) .then(move |result| { if let Err(err) = result { @@ -124,9 +124,9 @@ impl WasmCompiler { cache_.lock().unwrap().insert(url.clone(), module.clone()); } debug!("<<<<< wasm_compile_async END"); - Ok(module) + futures::future::ok(module) }); - Box::new(fut) + fut.boxed() } } |