Skip to content

Commit

Permalink
clippy (denoland#4618)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk authored Apr 4, 2020
1 parent 0db04d6 commit f527407
Show file tree
Hide file tree
Showing 32 changed files with 1 addition and 48 deletions.
1 change: 0 additions & 1 deletion cli/checksum.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use ring;
use std::fmt::Write;

pub fn gen(v: Vec<&[u8]>) -> String {
Expand Down
1 change: 0 additions & 1 deletion cli/compilers/compiler_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/compilers/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 0 additions & 2 deletions cli/deno_dir.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion cli/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/file_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/fmt_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/global_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/global_timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion cli/http_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions cli/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions cli/op_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
1 change: 0 additions & 1 deletion cli/ops/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion cli/ops/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
2 changes: 0 additions & 2 deletions cli/ops/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/ops/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions cli/ops/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions cli/ops/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion cli/ops/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 0 additions & 4 deletions cli/ops/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};
Expand All @@ -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));
Expand Down
1 change: 0 additions & 1 deletion cli/ops/tty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions cli/ops/web_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D>(
Expand Down
2 changes: 0 additions & 2 deletions cli/ops/worker_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions cli/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
1 change: 0 additions & 1 deletion cli/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion cli/source_maps.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/web_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cli/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions core/es_isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion core/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// descriptor (hence the different name).

use downcast_rs::Downcast;
use std;
use std::any::Any;
use std::collections::HashMap;

Expand Down

0 comments on commit f527407

Please sign in to comment.