diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler.rs | 14 | ||||
-rw-r--r-- | src/deno_dir.rs | 28 | ||||
-rw-r--r-- | src/eager_unix.rs | 7 | ||||
-rw-r--r-- | src/errors.rs | 8 | ||||
-rw-r--r-- | src/flags.rs | 5 | ||||
-rw-r--r-- | src/http_util.rs | 6 | ||||
-rw-r--r-- | src/isolate.rs | 24 | ||||
-rw-r--r-- | src/js_errors.rs | 8 | ||||
-rw-r--r-- | src/main.rs | 44 | ||||
-rw-r--r-- | src/msg_util.rs | 9 | ||||
-rw-r--r-- | src/ops.rs | 122 | ||||
-rw-r--r-- | src/permissions.rs | 8 | ||||
-rw-r--r-- | src/repl.rs | 10 | ||||
-rw-r--r-- | src/resolve_addr.rs | 2 | ||||
-rw-r--r-- | src/resources.rs | 22 | ||||
-rw-r--r-- | src/snapshot.rs | 2 | ||||
-rw-r--r-- | src/tokio_util.rs | 2 | ||||
-rw-r--r-- | src/version.rs | 3 | ||||
-rw-r--r-- | src/workers.rs | 18 |
19 files changed, 172 insertions, 170 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index 627be0a44..ca77213c7 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -1,11 +1,11 @@ // 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; diff --git a/src/deno_dir.rs b/src/deno_dir.rs index 3b35035d6..1838db771 100644 --- a/src/deno_dir.rs +++ b/src/deno_dir.rs @@ -1,15 +1,15 @@ // 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(); diff --git a/src/eager_unix.rs b/src/eager_unix.rs index 1c0f5bd33..1699c421c 100644 --- a/src/eager_unix.rs +++ b/src/eager_unix.rs @@ -1,8 +1,7 @@ // 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; diff --git a/src/errors.rs b/src/errors.rs index 55185df8e..0855e0079 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,7 @@ // 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), diff --git a/src/flags.rs b/src/flags.rs index 0f69286c7..739b9c9e8 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -1,8 +1,9 @@ // 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")); } diff --git a/src/http_util.rs b/src/http_util.rs index e3c21e0a9..8aadbe136 100644 --- a/src/http_util.rs +++ b/src/http_util.rs @@ -1,7 +1,7 @@ // 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}; diff --git a/src/isolate.rs b/src/isolate.rs index 03b73075e..b0bd085de 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -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 = diff --git a/src/js_errors.rs b/src/js_errors.rs index 905dcefbd..b16a6dc35 100644 --- a/src/js_errors.rs +++ b/src/js_errors.rs @@ -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()) diff --git a/src/main.rs b/src/main.rs index af9a02220..f17f1691c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,24 +1,24 @@ // 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()); } diff --git a/src/msg_util.rs b/src/msg_util.rs index 4517c068f..71bcc19d9 100644 --- a/src/msg_util.rs +++ b/src/msg_util.rs @@ -1,7 +1,9 @@ // 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); diff --git a/src/ops.rs b/src/ops.rs index 3db380e2e..48d0995c7 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -1,19 +1,22 @@ // 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() } }; diff --git a/src/permissions.rs b/src/permissions.rs index d86992da3..15415c347 100644 --- a/src/permissions.rs +++ b/src/permissions.rs @@ -1,9 +1,9 @@ -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}; diff --git a/src/repl.rs b/src/repl.rs index 835e6dbff..83e228b51 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -1,14 +1,14 @@ // 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; diff --git a/src/resolve_addr.rs b/src/resolve_addr.rs index a1e29058a..b283473f1 100644 --- a/src/resolve_addr.rs +++ b/src/resolve_addr.rs @@ -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()) } } diff --git a/src/resources.rs b/src/resources.rs index 7cd70f21b..fd136881d 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -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}; diff --git a/src/snapshot.rs b/src/snapshot.rs index e9457850e..16a186c29 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -1,5 +1,5 @@ // 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"))] diff --git a/src/tokio_util.rs b/src/tokio_util.rs index 2780822f1..32542aa43 100644 --- a/src/tokio_util.rs +++ b/src/tokio_util.rs @@ -1,5 +1,5 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -use resources::Resource; +use crate::resources::Resource; use futures; use futures::Future; diff --git a/src/version.rs b/src/version.rs index 0f328874f..1cf082257 100644 --- a/src/version.rs +++ b/src/version.rs @@ -1,5 +1,6 @@ // 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"); diff --git a/src/workers.rs b/src/workers.rs index e67d80489..d3b2ef008 100644 --- a/src/workers.rs +++ b/src/workers.rs @@ -1,13 +1,13 @@ // 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; |