mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Use futures 0.3 API (#3358)
This commit is contained in:
parent
cb00fd6e98
commit
8f9a942cb9
36 changed files with 1463 additions and 1018 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue