diff --git a/cli/checksum.rs b/cli/checksum.rs index f92fd62cff..232a19a49a 100644 --- a/cli/checksum.rs +++ b/cli/checksum.rs @@ -1,4 +1,3 @@ -use ring; use std::fmt::Write; pub fn gen(v: Vec<&[u8]>) -> String { diff --git a/cli/compilers/compiler_worker.rs b/cli/compilers/compiler_worker.rs index 37dda67ab3..a1d2dc71c0 100644 --- a/cli/compilers/compiler_worker.rs +++ b/cli/compilers/compiler_worker.rs @@ -3,7 +3,6 @@ use crate::ops; use crate::state::State; use crate::web_worker::WebWorker; use core::task::Context; -use deno_core; use deno_core::ErrBox; use deno_core::StartupData; use futures::future::Future; diff --git a/cli/compilers/wasm.rs b/cli/compilers/wasm.rs index ff7a04097d..d81138482b 100644 --- a/cli/compilers/wasm.rs +++ b/cli/compilers/wasm.rs @@ -12,7 +12,6 @@ use deno_core::Buf; use deno_core::ErrBox; use deno_core::ModuleSpecifier; use serde_derive::Deserialize; -use serde_json; use std::collections::HashMap; use std::sync::atomic::Ordering; use std::sync::{Arc, Mutex}; diff --git a/cli/deno_dir.rs b/cli/deno_dir.rs index 44f97abbd2..40496704a8 100644 --- a/cli/deno_dir.rs +++ b/cli/deno_dir.rs @@ -1,7 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use crate::disk_cache::DiskCache; -use dirs; -use std; use std::path::PathBuf; /// `DenoDir` serves as coordinator for multiple `DiskCache`s containing them diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index aaa6a12275..d73004b21f 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -9,7 +9,6 @@ use crate::colors; use crate::fmt_errors::format_maybe_source_line; use crate::fmt_errors::format_maybe_source_name; use crate::fmt_errors::DisplayFormatter; -use serde_json; use serde_json::value::Value; use std::error::Error; use std::fmt; diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index af512916d9..4fbeaf4534 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -11,7 +11,6 @@ use deno_core::ModuleSpecifier; use futures::future::FutureExt; use log::info; use regex::Regex; -use reqwest; use std::collections::HashMap; use std::fs; use std::future::Future; diff --git a/cli/fmt_errors.rs b/cli/fmt_errors.rs index 0a22b4625f..5ba0bce776 100644 --- a/cli/fmt_errors.rs +++ b/cli/fmt_errors.rs @@ -3,7 +3,6 @@ use crate::colors; use crate::source_maps::apply_source_map; use crate::source_maps::SourceMapGetter; -use deno_core; use deno_core::ErrBox; use deno_core::JSStackFrame; use std::error::Error; diff --git a/cli/global_state.rs b/cli/global_state.rs index 45a31406cb..129ab276a8 100644 --- a/cli/global_state.rs +++ b/cli/global_state.rs @@ -14,7 +14,6 @@ use crate::msg; use crate::permissions::DenoPermissions; use deno_core::ErrBox; use deno_core::ModuleSpecifier; -use std; use std::env; use std::ops::Deref; use std::sync::atomic::AtomicUsize; diff --git a/cli/global_timer.rs b/cli/global_timer.rs index 87c1d3a0da..d2d294de91 100644 --- a/cli/global_timer.rs +++ b/cli/global_timer.rs @@ -13,7 +13,6 @@ use futures::channel::oneshot; use futures::future::FutureExt; use std::future::Future; use std::time::Instant; -use tokio; #[derive(Default)] pub struct GlobalTimer { diff --git a/cli/http_util.rs b/cli/http_util.rs index 24a1b3b28f..12e70e3e74 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -3,7 +3,6 @@ use crate::version; use bytes::Bytes; use deno_core::ErrBox; use futures::future::FutureExt; -use reqwest; use reqwest::header::HeaderMap; use reqwest::header::HeaderValue; use reqwest::header::IF_NONE_MATCH; diff --git a/cli/inspector.rs b/cli/inspector.rs index ecc6665f57..54f431b3eb 100644 --- a/cli/inspector.rs +++ b/cli/inspector.rs @@ -5,7 +5,6 @@ //! https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/ use core::convert::Infallible as Never; // Alias for the future `!` type. -use deno_core; use deno_core::v8; use futures::channel::mpsc; use futures::channel::mpsc::UnboundedReceiver; @@ -37,7 +36,6 @@ use std::sync::Mutex; use std::sync::Once; use std::thread; use uuid::Uuid; -use warp; use warp::filters::ws; use warp::filters::ws::WebSocket; use warp::Filter; diff --git a/cli/op_error.rs b/cli/op_error.rs index 1d6236c773..258642f8a6 100644 --- a/cli/op_error.rs +++ b/cli/op_error.rs @@ -17,16 +17,11 @@ use crate::import_map::ImportMapError; use deno_core::ErrBox; use deno_core::ModuleResolutionError; -use dlopen; -use notify; -use reqwest; use rustyline::error::ReadlineError; -use std; use std::env::VarError; use std::error::Error; use std::fmt; use std::io; -use url; // Warning! The values in this enum are duplicated in js/errors.ts // Update carefully! diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs index d222787a62..54ea7ea13c 100644 --- a/cli/ops/fetch.rs +++ b/cli/ops/fetch.rs @@ -9,7 +9,6 @@ use futures::future::FutureExt; use http::header::HeaderName; use http::header::HeaderValue; use http::Method; -use std; use std::convert::From; pub fn init(i: &mut Isolate, s: &State) { diff --git a/cli/ops/fs.rs b/cli/ops/fs.rs index 458e1a14cb..288d56901b 100644 --- a/cli/ops/fs.rs +++ b/cli/ops/fs.rs @@ -13,7 +13,6 @@ use std::env::{current_dir, set_current_dir, temp_dir}; use std::io::SeekFrom; use std::path::{Path, PathBuf}; use std::time::UNIX_EPOCH; -use tokio; use rand::{thread_rng, Rng}; diff --git a/cli/ops/net.rs b/cli/ops/net.rs index f074ef9ee0..fd4227015a 100644 --- a/cli/ops/net.rs +++ b/cli/ops/net.rs @@ -7,13 +7,11 @@ use crate::state::State; use deno_core::*; use futures::future::poll_fn; use futures::future::FutureExt; -use std; use std::convert::From; use std::net::Shutdown; use std::net::SocketAddr; use std::task::Context; use std::task::Poll; -use tokio; use tokio::net::TcpListener; use tokio::net::TcpStream; use tokio::net::UdpSocket; diff --git a/cli/ops/os.rs b/cli/ops/os.rs index 4288567078..a58ed788be 100644 --- a/cli/ops/os.rs +++ b/cli/ops/os.rs @@ -6,7 +6,6 @@ use deno_core::*; use std::collections::HashMap; use std::env; use std::io::{Error, ErrorKind}; -use sys_info; use url::Url; pub fn init(i: &mut Isolate, s: &State) { diff --git a/cli/ops/process.rs b/cli/ops/process.rs index 0f25b6d38e..096b09bd0f 100644 --- a/cli/ops/process.rs +++ b/cli/ops/process.rs @@ -5,11 +5,9 @@ use crate::op_error::OpError; use crate::signal::kill; use crate::state::State; use deno_core::*; -use futures; use futures::future::poll_fn; use futures::future::FutureExt; use futures::TryFutureExt; -use std; use std::convert::From; use tokio::process::Command; diff --git a/cli/ops/signal.rs b/cli/ops/signal.rs index ac9cf8e342..b550a68cfb 100644 --- a/cli/ops/signal.rs +++ b/cli/ops/signal.rs @@ -9,8 +9,6 @@ use super::dispatch_json::Deserialize; #[cfg(unix)] use futures::future::{poll_fn, FutureExt}; #[cfg(unix)] -use serde_json; -#[cfg(unix)] use std::task::Waker; #[cfg(unix)] use tokio::signal::unix::{signal, Signal, SignalKind}; diff --git a/cli/ops/timers.rs b/cli/ops/timers.rs index 33aa7f8285..29d2514c9b 100644 --- a/cli/ops/timers.rs +++ b/cli/ops/timers.rs @@ -4,7 +4,6 @@ use crate::op_error::OpError; use crate::state::State; use deno_core::*; use futures::future::FutureExt; -use std; use std::time::Duration; use std::time::Instant; diff --git a/cli/ops/tls.rs b/cli/ops/tls.rs index 642284ea26..a27d473da4 100644 --- a/cli/ops/tls.rs +++ b/cli/ops/tls.rs @@ -7,7 +7,6 @@ use crate::state::State; use deno_core::*; use futures::future::poll_fn; use futures::future::FutureExt; -use std; use std::convert::From; use std::fs::File; use std::io::BufReader; @@ -16,7 +15,6 @@ use std::path::Path; use std::sync::Arc; use std::task::Context; use std::task::Poll; -use tokio; use tokio::net::TcpListener; use tokio::net::TcpStream; use tokio_rustls::{rustls::ClientConfig, TlsConnector}; @@ -27,9 +25,7 @@ use tokio_rustls::{ }, TlsAcceptor, }; -use webpki; use webpki::DNSNameRef; -use webpki_roots; pub fn init(i: &mut Isolate, s: &State) { i.register_op("op_connect_tls", s.stateful_json_op(op_connect_tls)); diff --git a/cli/ops/tty.rs b/cli/ops/tty.rs index c44ab946f7..ebe6c39e39 100644 --- a/cli/ops/tty.rs +++ b/cli/ops/tty.rs @@ -3,7 +3,6 @@ use super::io::{StreamResource, StreamResourceHolder}; use crate::op_error::OpError; use crate::ops::json_op; use crate::state::State; -use atty; use deno_core::*; #[cfg(unix)] use nix::sys::termios; diff --git a/cli/ops/web_worker.rs b/cli/ops/web_worker.rs index f293fcf7e6..dd7b6e34a1 100644 --- a/cli/ops/web_worker.rs +++ b/cli/ops/web_worker.rs @@ -5,10 +5,8 @@ use crate::ops::json_op; use crate::state::State; use crate::worker::WorkerEvent; use deno_core::*; -use futures; use futures::channel::mpsc; use futures::sink::SinkExt; -use std; use std::convert::From; pub fn web_worker_op( diff --git a/cli/ops/worker_host.rs b/cli/ops/worker_host.rs index 0690a3977c..ee448eb834 100644 --- a/cli/ops/worker_host.rs +++ b/cli/ops/worker_host.rs @@ -12,10 +12,8 @@ use crate::web_worker::WebWorker; use crate::worker::WorkerEvent; use crate::worker::WorkerHandle; use deno_core::*; -use futures; use futures::future::FutureExt; use futures::future::TryFutureExt; -use std; use std::convert::From; use std::thread::JoinHandle; diff --git a/cli/permissions.rs b/cli/permissions.rs index 16e3eebb78..2179ed33f8 100644 --- a/cli/permissions.rs +++ b/cli/permissions.rs @@ -2,8 +2,6 @@ use crate::colors; use crate::flags::Flags; use crate::op_error::OpError; -#[cfg(not(test))] -use atty; use std::collections::HashSet; use std::fmt; #[cfg(not(test))] diff --git a/cli/repl.rs b/cli/repl.rs index 8280670ba7..abc592c46e 100644 --- a/cli/repl.rs +++ b/cli/repl.rs @@ -2,7 +2,6 @@ use crate::deno_dir::DenoDir; use crate::op_error::OpError; use deno_core::ErrBox; -use rustyline; use std::fs; use std::path::PathBuf; diff --git a/cli/source_maps.rs b/cli/source_maps.rs index b5c5c91ee3..bdfee11e93 100644 --- a/cli/source_maps.rs +++ b/cli/source_maps.rs @@ -1,6 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. //! This mod provides functions to remap a deno_core::deno_core::JSError based on a source map -use deno_core; use deno_core::JSStackFrame; use sourcemap::SourceMap; use std::collections::HashMap; diff --git a/cli/state.rs b/cli/state.rs index fe5aa1b74c..d55e4e5ebb 100644 --- a/cli/state.rs +++ b/cli/state.rs @@ -22,7 +22,6 @@ use futures::future::TryFutureExt; use rand::rngs::StdRng; use rand::SeedableRng; use serde_json::Value; -use std; use std::cell::RefCell; use std::collections::HashMap; use std::ops::Deref; diff --git a/cli/test_runner.rs b/cli/test_runner.rs index 3f94be69a9..dd87ab7ec5 100644 --- a/cli/test_runner.rs +++ b/cli/test_runner.rs @@ -3,7 +3,6 @@ use crate::fs as deno_fs; use crate::installer::is_remote_url; use deno_core::ErrBox; -use std; use std::path::Path; use std::path::PathBuf; use url::Url; diff --git a/cli/web_worker.rs b/cli/web_worker.rs index fe511d6184..683ba9ef49 100644 --- a/cli/web_worker.rs +++ b/cli/web_worker.rs @@ -3,7 +3,6 @@ use crate::ops; use crate::state::State; use crate::worker::Worker; use crate::worker::WorkerEvent; -use deno_core; use deno_core::ErrBox; use deno_core::StartupData; use futures::future::FutureExt; diff --git a/cli/worker.rs b/cli/worker.rs index 7c102a6023..9e1a646d51 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -4,7 +4,6 @@ use crate::inspector::DenoInspector; use crate::ops; use crate::state::DebugType; use crate::state::State; -use deno_core; use deno_core::Buf; use deno_core::ErrBox; use deno_core::ModuleId; diff --git a/core/es_isolate.rs b/core/es_isolate.rs index a43358a247..aa17c1a467 100644 --- a/core/es_isolate.rs +++ b/core/es_isolate.rs @@ -424,9 +424,8 @@ impl EsIsolate { let is_main = load.state == LoadState::LoadingRoot && !load.is_dynamic_import(); - let referrer_name = &module_url_found.to_string(); let referrer_specifier = - ModuleSpecifier::resolve_url(referrer_name).unwrap(); + ModuleSpecifier::resolve_url(&module_url_found).unwrap(); // #A There are 3 cases to handle at this moment: // 1. Source code resolved result have the same module name as requested diff --git a/core/resources.rs b/core/resources.rs index c9144f3b23..ba69e8c98d 100644 --- a/core/resources.rs +++ b/core/resources.rs @@ -7,7 +7,6 @@ // descriptor (hence the different name). use downcast_rs::Downcast; -use std; use std::any::Any; use std::collections::HashMap;