未验证 提交 526fdac0 编写于 作者: A Andy Hayden 提交者: Bert Belder

Update to rust 2018 edition

上级 7d08db21
......@@ -7,6 +7,7 @@
[package]
name = "deno"
version = "0.2.6"
edition = "2018"
[dependencies]
atty = "0.2.11"
......
此差异已折叠。
......@@ -50,6 +50,7 @@ template("rust_crate") {
"crate_type",
"crate_version",
"deps",
"edition",
"inputs",
"features",
"is_test",
......@@ -68,6 +69,9 @@ template("rust_crate") {
if (!defined(deps)) {
deps = []
}
if (!defined(edition)) {
edition = "2018"
}
if (!defined(is_test)) {
is_test = false
}
......@@ -175,6 +179,7 @@ template("rust_crate") {
"--crate-name=$crate_name",
"--crate-type=$crate_type",
"--emit=$emit_type,dep-info",
"--edition=$edition",
"--out-dir=" + rebase_path(out_dir, root_build_dir),
# This is to disambiguate multiple versions of the same crate.
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use isolate::Buf;
use isolate::IsolateState;
use msg;
use resources;
use resources::Resource;
use resources::ResourceId;
use workers;
use crate::isolate::Buf;
use crate::isolate::IsolateState;
use crate::msg;
use crate::resources;
use crate::resources::Resource;
use crate::resources::ResourceId;
use crate::workers;
use futures::Future;
use serde_json;
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use compiler::CodeFetchOutput;
use dirs;
use errors;
use errors::DenoError;
use errors::DenoResult;
use errors::ErrorKind;
use fs as deno_fs;
use http_util;
use js_errors::SourceMapGetter;
use msg;
use crate::compiler::CodeFetchOutput;
use crate::errors;
use crate::errors::DenoError;
use crate::errors::DenoResult;
use crate::errors::ErrorKind;
use crate::fs as deno_fs;
use crate::http_util;
use crate::js_errors::SourceMapGetter;
use crate::msg;
use dirs;
use ring;
use std;
use std::fmt::Write;
......@@ -395,7 +395,7 @@ impl DenoDir {
match j.scheme() {
"file" => {
let mut p = deno_fs::normalize_path(j.to_file_path().unwrap().as_ref());
let p = deno_fs::normalize_path(j.to_file_path().unwrap().as_ref());
module_name = p.clone();
filename = p;
}
......@@ -540,8 +540,8 @@ fn filter_shebang(code: String) -> String {
#[cfg(test)]
mod tests {
use super::*;
use crate::tokio_util;
use tempfile::TempDir;
use tokio_util;
fn test_setup() -> (TempDir, DenoDir) {
let temp_dir = TempDir::new().expect("tempdir fail");
......@@ -751,7 +751,7 @@ mod tests {
#[test]
fn test_fetch_source_1() {
use tokio_util;
use crate::tokio_util;
// http_util::fetch_sync_string requires tokio
tokio_util::init(|| {
let (_temp_dir, deno_dir) = test_setup();
......@@ -786,7 +786,7 @@ mod tests {
#[test]
fn test_fetch_source_2() {
use tokio_util;
use crate::tokio_util;
// http_util::fetch_sync_string requires tokio
tokio_util::init(|| {
let (_temp_dir, deno_dir) = test_setup();
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use resources::{EagerAccept, EagerRead, EagerWrite, Resource};
use tokio_util;
use tokio_write;
use crate::resources::{EagerAccept, EagerRead, EagerWrite, Resource};
use crate::tokio_util;
use crate::tokio_write;
use futures::future::{self, Either};
use std;
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
pub use msg::ErrorKind;
use resolve_addr::ResolveAddrError;
pub use crate::msg::ErrorKind;
use crate::resolve_addr::ResolveAddrError;
use hyper;
use std;
......@@ -95,7 +95,7 @@ impl DenoError {
}
impl fmt::Display for DenoError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.repr {
Repr::Simple(_kind, ref err_str) => f.pad(err_str),
Repr::IoErr(ref err) => err.fmt(f),
......@@ -115,7 +115,7 @@ impl std::error::Error for DenoError {
}
}
fn cause(&self) -> Option<&std::error::Error> {
fn cause(&self) -> Option<&dyn std::error::Error> {
match self.repr {
Repr::Simple(_kind, ref _msg) => None,
Repr::IoErr(ref err) => Some(err),
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use crate::libdeno;
use getopts;
use getopts::Options;
use libc::c_int;
use libdeno;
use std::ffi::CStr;
use std::ffi::CString;
use std::mem;
......@@ -258,7 +259,7 @@ fn v8_set_flags_preprocess(args: Vec<String>) -> (Vec<String>, Vec<String>) {
args.into_iter().partition(|ref a| a.as_str() == "--help");
// Replace args being sent to V8
for mut a in &mut v8_args {
for a in &mut v8_args {
if a == "--v8-options" {
mem::swap(a, &mut String::from("--help"));
}
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use errors;
use errors::{DenoError, DenoResult};
use tokio_util;
use crate::errors;
use crate::errors::{DenoError, DenoResult};
use crate::tokio_util;
use futures::future::{loop_fn, Loop};
use futures::{future, Future, Stream};
......
......@@ -3,16 +3,17 @@
// TODO Currently this module uses Tokio, but it would be nice if they were
// decoupled.
use compiler::compile_sync;
use compiler::CodeFetchOutput;
use deno_dir;
use errors::DenoError;
use errors::DenoResult;
use flags;
use js_errors::JSError;
use libdeno;
use msg;
use permissions::DenoPermissions;
use crate::compiler::compile_sync;
use crate::compiler::CodeFetchOutput;
use crate::deno_dir;
use crate::errors::DenoError;
use crate::errors::DenoResult;
use crate::flags;
use crate::js_errors::JSError;
use crate::libdeno;
use crate::msg;
use crate::permissions::DenoPermissions;
use crate::tokio_util;
use futures::sync::mpsc as async_mpsc;
use futures::Future;
......@@ -30,7 +31,6 @@ use std::sync::Mutex;
use std::time::Duration;
use std::time::Instant;
use tokio;
use tokio_util;
// Buf represents a byte array returned from a "Op".
// The message might be empty (which will be translated into a null object on
......@@ -40,7 +40,7 @@ pub type Buf = Box<[u8]>;
// JS promises in Deno map onto a specific Future
// which yields either a DenoError or a byte array.
pub type Op = Future<Item = Buf, Error = DenoError> + Send;
pub type Op = dyn Future<Item = Buf, Error = DenoError> + Send;
// Returns (is_sync, op)
pub type Dispatch =
......
......@@ -184,7 +184,7 @@ impl StackFrame {
fn apply_source_map(
&self,
mappings_map: &mut CachedMaps,
getter: &SourceMapGetter,
getter: &dyn SourceMapGetter,
) -> StackFrame {
let maybe_sm =
get_mappings(self.script_name.as_ref(), mappings_map, getter);
......@@ -319,7 +319,7 @@ impl JSError {
})
}
pub fn apply_source_map(&self, getter: &SourceMapGetter) -> Self {
pub fn apply_source_map(&self, getter: &dyn SourceMapGetter) -> Self {
let mut mappings_map: CachedMaps = HashMap::new();
let mut frames = Vec::<StackFrame>::new();
for frame in &self.frames {
......@@ -344,7 +344,7 @@ impl JSError {
fn parse_map_string(
script_name: &str,
getter: &SourceMapGetter,
getter: &dyn SourceMapGetter,
) -> Option<SourceMap> {
match script_name {
// The bundle does not get built for 'cargo check', so we don't embed the
......@@ -365,7 +365,7 @@ fn parse_map_string(
fn get_mappings<'a>(
script_name: &str,
mappings_map: &'a mut CachedMaps,
getter: &SourceMapGetter,
getter: &dyn SourceMapGetter,
) -> &'a Option<SourceMap> {
mappings_map
.entry(script_name.to_string())
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
extern crate dirs;
extern crate flatbuffers;
extern crate getopts;
extern crate http;
extern crate hyper;
extern crate hyper_rustls;
extern crate libc;
extern crate rand;
extern crate remove_dir_all;
extern crate ring;
extern crate rustyline;
extern crate source_map_mappings;
extern crate tempfile;
extern crate tokio;
extern crate tokio_executor;
extern crate tokio_fs;
extern crate tokio_io;
extern crate tokio_process;
extern crate tokio_threadpool;
extern crate url;
use dirs;
use flatbuffers;
use getopts;
use http;
use hyper;
use hyper_rustls;
use libc;
use rand;
use remove_dir_all;
use ring;
use rustyline;
use source_map_mappings;
use tempfile;
use tokio;
use tokio_executor;
use tokio_fs;
use tokio_io;
use tokio_process;
use tokio_threadpool;
use url;
#[macro_use]
extern crate lazy_static;
......@@ -63,11 +63,11 @@ static LOGGER: Logger = Logger;
struct Logger;
impl log::Log for Logger {
fn enabled(&self, metadata: &log::Metadata) -> bool {
fn enabled(&self, metadata: &log::Metadata<'_>) -> bool {
metadata.level() <= log::max_level()
}
fn log(&self, record: &log::Record) {
fn log(&self, record: &log::Record<'_>) {
if self.enabled(record.metadata()) {
println!("{} RS - {}", record.level(), record.args());
}
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// Helpers for serialization.
use errors;
use errors::DenoResult;
use crate::errors;
use crate::errors::DenoResult;
use crate::msg;
use flatbuffers;
use http::header::HeaderName;
use http::uri::Uri;
......@@ -11,7 +13,6 @@ use hyper::header::HeaderValue;
use hyper::Body;
use hyper::Request;
use hyper::Response;
use msg;
use std::str::FromStr;
type Headers = HeaderMap<HeaderValue>;
......@@ -94,7 +95,7 @@ pub fn serialize_http_response<'bldr>(
}
pub fn deserialize_request(
header_msg: msg::HttpHeader,
header_msg: msg::HttpHeader<'_>,
body: Body,
) -> DenoResult<Request<Body>> {
let mut r = Request::new(body);
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use errors;
use errors::{DenoError, DenoResult, ErrorKind};
use fs as deno_fs;
use http_util;
use isolate::Buf;
use isolate::Isolate;
use isolate::IsolateState;
use isolate::Op;
use libdeno;
use msg;
use msg_util;
use resolve_addr::resolve_addr;
use resources;
use resources::Resource;
use version;
use crate::errors;
use crate::errors::{DenoError, DenoResult, ErrorKind};
use crate::fs as deno_fs;
use crate::http_util;
use crate::isolate::Buf;
use crate::isolate::Isolate;
use crate::isolate::IsolateState;
use crate::isolate::Op;
use crate::libdeno;
use crate::msg;
use crate::msg_util;
use crate::repl;
use crate::resolve_addr::resolve_addr;
use crate::resources;
use crate::resources::table_entries;
use crate::resources::Resource;
use crate::tokio_util;
use crate::version;
use flatbuffers::FlatBufferBuilder;
use futures;
......@@ -24,8 +27,6 @@ use futures::Stream;
use hyper;
use hyper::rt::Future;
use remove_dir_all::remove_dir_all;
use repl;
use resources::table_entries;
use std;
use std::convert::From;
use std::fs;
......@@ -45,14 +46,13 @@ use tokio::net::TcpListener;
use tokio::net::TcpStream;
use tokio_process::CommandExt;
use tokio_threadpool;
use tokio_util;
type OpResult = DenoResult<Buf>;
// TODO Ideally we wouldn't have to box the Op being returned.
// The box is just to make it easier to get a prototype refactor working.
type OpCreator =
fn(state: &Arc<IsolateState>, base: &msg::Base, data: libdeno::deno_buf)
fn(state: &Arc<IsolateState>, base: &msg::Base<'_>, data: libdeno::deno_buf)
-> Box<Op>;
#[inline]
......@@ -175,7 +175,7 @@ pub fn dispatch(
fn op_exit(
_config: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
_data: libdeno::deno_buf,
) -> Box<Op> {
let inner = base.inner_as_exit().unwrap();
......@@ -184,7 +184,7 @@ fn op_exit(
fn op_start(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -232,8 +232,8 @@ fn op_start(
fn serialize_response(
cmd_id: u32,
builder: &mut FlatBufferBuilder,
mut args: msg::BaseArgs,
builder: &mut FlatBufferBuilder<'_>,
mut args: msg::BaseArgs<'_>,
) -> Buf {
args.cmd_id = cmd_id;
let base = msg::Base::create(builder, &args);
......@@ -257,7 +257,7 @@ pub fn odd_future(err: DenoError) -> Box<Op> {
// https://github.com/denoland/deno/blob/golang/os.go#L100-L154
fn op_code_fetch(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -300,7 +300,7 @@ fn op_code_fetch(
// https://github.com/denoland/deno/blob/golang/os.go#L156-L169
fn op_code_cache(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -319,7 +319,7 @@ fn op_code_cache(
fn op_chdir(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -333,7 +333,7 @@ fn op_chdir(
fn op_set_timeout(
isolate: &Isolate,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -351,7 +351,7 @@ fn op_set_timeout(
fn op_set_env(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -367,7 +367,7 @@ fn op_set_env(
fn op_env(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -399,7 +399,7 @@ fn op_env(
fn op_fetch(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
let inner = base.inner_as_fetch().unwrap();
......@@ -486,7 +486,7 @@ where
fn op_make_temp_dir(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -535,7 +535,7 @@ fn op_make_temp_dir(
fn op_mkdir(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -555,7 +555,7 @@ fn op_mkdir(
fn op_chmod(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -588,7 +588,7 @@ fn op_chmod(
fn op_open(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -664,7 +664,7 @@ fn op_open(
fn op_close(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -681,7 +681,7 @@ fn op_close(
fn op_shutdown(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -707,7 +707,7 @@ fn op_shutdown(
fn op_read(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
let cmd_id = base.cmd_id();
......@@ -745,7 +745,7 @@ fn op_read(
fn op_write(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
let cmd_id = base.cmd_id();
......@@ -782,7 +782,7 @@ fn op_write(
fn op_remove(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -812,7 +812,7 @@ fn op_remove(
// Prototype https://github.com/denoland/deno/blob/golang/os.go#L171-L184
fn op_read_file(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -846,7 +846,7 @@ fn op_read_file(
fn op_copy_file(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -898,7 +898,7 @@ fn get_mode(_perm: &fs::Permissions) -> u32 {
fn op_cwd(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -924,7 +924,7 @@ fn op_cwd(
fn op_stat(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -971,7 +971,7 @@ fn op_stat(
fn op_read_dir(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1029,7 +1029,7 @@ fn op_read_dir(
fn op_write_file(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
let inner = base.inner_as_write_file().unwrap();
......@@ -1049,7 +1049,7 @@ fn op_write_file(
fn op_rename(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1069,7 +1069,7 @@ fn op_rename(
fn op_symlink(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1098,7 +1098,7 @@ fn op_symlink(
fn op_read_link(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1131,7 +1131,7 @@ fn op_read_link(
fn op_repl_start(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1162,7 +1162,7 @@ fn op_repl_start(
fn op_repl_readline(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1200,7 +1200,7 @@ fn op_repl_readline(
fn op_truncate(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1223,7 +1223,7 @@ fn op_truncate(
fn op_listen(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1288,7 +1288,7 @@ fn new_conn(cmd_id: u32, tcp_stream: TcpStream) -> OpResult {
fn op_accept(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1314,7 +1314,7 @@ fn op_accept(
fn op_dial(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1340,7 +1340,7 @@ fn op_dial(
fn op_metrics(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1364,7 +1364,7 @@ fn op_metrics(
fn op_resources(
_state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1416,7 +1416,7 @@ fn subprocess_stdio_map(v: msg::ProcessStdio) -> std::process::Stdio {
fn op_run(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert!(base.sync());
......@@ -1484,7 +1484,7 @@ fn op_run(
fn op_run_status(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1560,7 +1560,7 @@ impl Future for GetMessageFuture {
fn op_worker_get_message(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
assert_eq!(data.len(), 0);
......@@ -1594,7 +1594,7 @@ fn op_worker_get_message(
fn op_worker_post_message(
state: &Arc<IsolateState>,
base: &msg::Base,
base: &msg::Base<'_>,
data: libdeno::deno_buf,
) -> Box<Op> {
let cmd_id = base.cmd_id();
......@@ -1605,7 +1605,7 @@ fn op_worker_post_message(
let tx = match state.worker_channels {
None => panic!("expected worker_channels"),
Some(ref wc) => {
let mut wc = wc.lock().unwrap();
let wc = wc.lock().unwrap();
wc.0.clone()
}
};
......
extern crate atty;
use atty;
use flags::DenoFlags;
use crate::flags::DenoFlags;
use errors::permission_denied;
use errors::DenoResult;
use crate::errors::permission_denied;
use crate::errors::DenoResult;
use std::io;
use std::sync::atomic::{AtomicBool, Ordering};
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
extern crate rustyline;
use rustyline;
use rustyline::error::ReadlineError::Interrupted;
use msg::ErrorKind;
use crate::msg::ErrorKind;
use std::error::Error;
use deno_dir::DenoDir;
use errors::new as deno_error;
use errors::DenoResult;
use crate::deno_dir::DenoDir;
use crate::errors::new as deno_error;
use crate::errors::DenoResult;
use std::path::PathBuf;
use std::process::exit;
......
......@@ -28,7 +28,7 @@ pub enum ResolveAddrError {
}
impl fmt::Display for ResolveAddrError {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.write_str(self.description())
}
}
......
......@@ -9,16 +9,17 @@
// handlers) look up resources by their integer id here.
#[cfg(unix)]
use eager_unix as eager;
use errors;
use errors::bad_resource;
use errors::DenoError;
use errors::DenoResult;
use http_body::HttpBody;
use isolate::WorkerChannels;
use repl::Repl;
use tokio_util;
use tokio_write;
use crate::eager_unix as eager;
use crate::errors;
use crate::errors::bad_resource;
use crate::errors::DenoError;
use crate::errors::DenoResult;
use crate::http_body::HttpBody;
use crate::isolate::Buf;
use crate::isolate::WorkerChannels;
use crate::repl::Repl;
use crate::tokio_util;
use crate::tokio_write;
use futures;
use futures::future::{Either, FutureResult};
......@@ -27,7 +28,6 @@ use futures::Poll;
use futures::Sink;
use futures::Stream;
use hyper;
use isolate::Buf;
use std;
use std::collections::HashMap;
use std::io::{Error, Read, Write};
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use libdeno::deno_buf;
use crate::libdeno::deno_buf;
pub fn deno_snapshot() -> deno_buf {
#[cfg(not(feature = "check-only"))]
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use resources::Resource;
use crate::resources::Resource;
use futures;
use futures::Future;
......
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use libdeno;
use crate::libdeno;
use std::ffi::CStr;
pub const DENO: &str = env!("CARGO_PKG_VERSION");
......
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
use isolate::Buf;
use isolate::Isolate;
use isolate::IsolateState;
use isolate::WorkerChannels;
use js_errors::JSError;
use ops;
use resources;
use snapshot;
use tokio_util;
use crate::isolate::Buf;
use crate::isolate::Isolate;
use crate::isolate::IsolateState;
use crate::isolate::WorkerChannels;
use crate::js_errors::JSError;
use crate::ops;
use crate::resources;
use crate::snapshot;
use crate::tokio_util;
use futures::sync::mpsc;
use futures::sync::oneshot;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册