diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-11-17 01:17:47 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-16 19:17:47 -0500 |
commit | 8f9a942cb911ed017eb128e9fbeb6f9a48e69601 (patch) | |
tree | 4f56623262f84becac18546d9da3d5d9ce9c8735 /cli/compilers/js.rs | |
parent | cb00fd6e988184420f842b1e77ca4cf627d32773 (diff) |
Use futures 0.3 API (#3358)
Diffstat (limited to 'cli/compilers/js.rs')
-rw-r--r-- | cli/compilers/js.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/compilers/js.rs b/cli/compilers/js.rs index af79690d6..b6277659f 100644 --- a/cli/compilers/js.rs +++ b/cli/compilers/js.rs @@ -2,6 +2,8 @@ use crate::compilers::CompiledModule; use crate::compilers::CompiledModuleFuture; use crate::file_fetcher::SourceFile; +use crate::futures::future::FutureExt; +use std::pin::Pin; use std::str; pub struct JsCompiler {} @@ -10,7 +12,7 @@ impl JsCompiler { pub fn compile_async( self: &Self, source_file: &SourceFile, - ) -> Box<CompiledModuleFuture> { + ) -> Pin<Box<CompiledModuleFuture>> { let module = CompiledModule { code: str::from_utf8(&source_file.source_code) .unwrap() @@ -18,6 +20,6 @@ impl JsCompiler { name: source_file.url.to_string(), }; - Box::new(futures::future::ok(module)) + futures::future::ok(module).boxed() } } |