mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
clippy (#4618)
This commit is contained in:
parent
0db04d6a42
commit
f527407287
32 changed files with 1 additions and 48 deletions
|
@ -1,4 +1,3 @@
|
||||||
use ring;
|
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
pub fn gen(v: Vec<&[u8]>) -> String {
|
pub fn gen(v: Vec<&[u8]>) -> String {
|
||||||
|
|
|
@ -3,7 +3,6 @@ use crate::ops;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use crate::web_worker::WebWorker;
|
use crate::web_worker::WebWorker;
|
||||||
use core::task::Context;
|
use core::task::Context;
|
||||||
use deno_core;
|
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::StartupData;
|
use deno_core::StartupData;
|
||||||
use futures::future::Future;
|
use futures::future::Future;
|
||||||
|
|
|
@ -12,7 +12,6 @@ use deno_core::Buf;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
use serde_json;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
use crate::disk_cache::DiskCache;
|
use crate::disk_cache::DiskCache;
|
||||||
use dirs;
|
|
||||||
use std;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
/// `DenoDir` serves as coordinator for multiple `DiskCache`s containing them
|
/// `DenoDir` serves as coordinator for multiple `DiskCache`s containing them
|
||||||
|
|
|
@ -9,7 +9,6 @@ use crate::colors;
|
||||||
use crate::fmt_errors::format_maybe_source_line;
|
use crate::fmt_errors::format_maybe_source_line;
|
||||||
use crate::fmt_errors::format_maybe_source_name;
|
use crate::fmt_errors::format_maybe_source_name;
|
||||||
use crate::fmt_errors::DisplayFormatter;
|
use crate::fmt_errors::DisplayFormatter;
|
||||||
use serde_json;
|
|
||||||
use serde_json::value::Value;
|
use serde_json::value::Value;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
|
@ -11,7 +11,6 @@ use deno_core::ModuleSpecifier;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use log::info;
|
use log::info;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use reqwest;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
use crate::colors;
|
use crate::colors;
|
||||||
use crate::source_maps::apply_source_map;
|
use crate::source_maps::apply_source_map;
|
||||||
use crate::source_maps::SourceMapGetter;
|
use crate::source_maps::SourceMapGetter;
|
||||||
use deno_core;
|
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::JSStackFrame;
|
use deno_core::JSStackFrame;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
|
@ -14,7 +14,6 @@ use crate::msg;
|
||||||
use crate::permissions::DenoPermissions;
|
use crate::permissions::DenoPermissions;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::ModuleSpecifier;
|
use deno_core::ModuleSpecifier;
|
||||||
use std;
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
|
|
|
@ -13,7 +13,6 @@ use futures::channel::oneshot;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use tokio;
|
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct GlobalTimer {
|
pub struct GlobalTimer {
|
||||||
|
|
|
@ -3,7 +3,6 @@ use crate::version;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use reqwest;
|
|
||||||
use reqwest::header::HeaderMap;
|
use reqwest::header::HeaderMap;
|
||||||
use reqwest::header::HeaderValue;
|
use reqwest::header::HeaderValue;
|
||||||
use reqwest::header::IF_NONE_MATCH;
|
use reqwest::header::IF_NONE_MATCH;
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
//! https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/
|
//! https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/
|
||||||
|
|
||||||
use core::convert::Infallible as Never; // Alias for the future `!` type.
|
use core::convert::Infallible as Never; // Alias for the future `!` type.
|
||||||
use deno_core;
|
|
||||||
use deno_core::v8;
|
use deno_core::v8;
|
||||||
use futures::channel::mpsc;
|
use futures::channel::mpsc;
|
||||||
use futures::channel::mpsc::UnboundedReceiver;
|
use futures::channel::mpsc::UnboundedReceiver;
|
||||||
|
@ -37,7 +36,6 @@ use std::sync::Mutex;
|
||||||
use std::sync::Once;
|
use std::sync::Once;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
use warp;
|
|
||||||
use warp::filters::ws;
|
use warp::filters::ws;
|
||||||
use warp::filters::ws::WebSocket;
|
use warp::filters::ws::WebSocket;
|
||||||
use warp::Filter;
|
use warp::Filter;
|
||||||
|
|
|
@ -17,16 +17,11 @@
|
||||||
use crate::import_map::ImportMapError;
|
use crate::import_map::ImportMapError;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::ModuleResolutionError;
|
use deno_core::ModuleResolutionError;
|
||||||
use dlopen;
|
|
||||||
use notify;
|
|
||||||
use reqwest;
|
|
||||||
use rustyline::error::ReadlineError;
|
use rustyline::error::ReadlineError;
|
||||||
use std;
|
|
||||||
use std::env::VarError;
|
use std::env::VarError;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io;
|
use std::io;
|
||||||
use url;
|
|
||||||
|
|
||||||
// Warning! The values in this enum are duplicated in js/errors.ts
|
// Warning! The values in this enum are duplicated in js/errors.ts
|
||||||
// Update carefully!
|
// Update carefully!
|
||||||
|
|
|
@ -9,7 +9,6 @@ use futures::future::FutureExt;
|
||||||
use http::header::HeaderName;
|
use http::header::HeaderName;
|
||||||
use http::header::HeaderValue;
|
use http::header::HeaderValue;
|
||||||
use http::Method;
|
use http::Method;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
|
|
||||||
pub fn init(i: &mut Isolate, s: &State) {
|
pub fn init(i: &mut Isolate, s: &State) {
|
||||||
|
|
|
@ -13,7 +13,6 @@ use std::env::{current_dir, set_current_dir, temp_dir};
|
||||||
use std::io::SeekFrom;
|
use std::io::SeekFrom;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::time::UNIX_EPOCH;
|
use std::time::UNIX_EPOCH;
|
||||||
use tokio;
|
|
||||||
|
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,11 @@ use crate::state::State;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures::future::poll_fn;
|
use futures::future::poll_fn;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::net::Shutdown;
|
use std::net::Shutdown;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::task::Context;
|
use std::task::Context;
|
||||||
use std::task::Poll;
|
use std::task::Poll;
|
||||||
use tokio;
|
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
use tokio::net::UdpSocket;
|
use tokio::net::UdpSocket;
|
||||||
|
|
|
@ -6,7 +6,6 @@ use deno_core::*;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::io::{Error, ErrorKind};
|
use std::io::{Error, ErrorKind};
|
||||||
use sys_info;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
pub fn init(i: &mut Isolate, s: &State) {
|
pub fn init(i: &mut Isolate, s: &State) {
|
||||||
|
|
|
@ -5,11 +5,9 @@ use crate::op_error::OpError;
|
||||||
use crate::signal::kill;
|
use crate::signal::kill;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures;
|
|
||||||
use futures::future::poll_fn;
|
use futures::future::poll_fn;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use futures::TryFutureExt;
|
use futures::TryFutureExt;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use tokio::process::Command;
|
use tokio::process::Command;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ use super::dispatch_json::Deserialize;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use futures::future::{poll_fn, FutureExt};
|
use futures::future::{poll_fn, FutureExt};
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use serde_json;
|
|
||||||
#[cfg(unix)]
|
|
||||||
use std::task::Waker;
|
use std::task::Waker;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use tokio::signal::unix::{signal, Signal, SignalKind};
|
use tokio::signal::unix::{signal, Signal, SignalKind};
|
||||||
|
|
|
@ -4,7 +4,6 @@ use crate::op_error::OpError;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use std;
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ use crate::state::State;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures::future::poll_fn;
|
use futures::future::poll_fn;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
|
@ -16,7 +15,6 @@ use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::task::Context;
|
use std::task::Context;
|
||||||
use std::task::Poll;
|
use std::task::Poll;
|
||||||
use tokio;
|
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
use tokio_rustls::{rustls::ClientConfig, TlsConnector};
|
use tokio_rustls::{rustls::ClientConfig, TlsConnector};
|
||||||
|
@ -27,9 +25,7 @@ use tokio_rustls::{
|
||||||
},
|
},
|
||||||
TlsAcceptor,
|
TlsAcceptor,
|
||||||
};
|
};
|
||||||
use webpki;
|
|
||||||
use webpki::DNSNameRef;
|
use webpki::DNSNameRef;
|
||||||
use webpki_roots;
|
|
||||||
|
|
||||||
pub fn init(i: &mut Isolate, s: &State) {
|
pub fn init(i: &mut Isolate, s: &State) {
|
||||||
i.register_op("op_connect_tls", s.stateful_json_op(op_connect_tls));
|
i.register_op("op_connect_tls", s.stateful_json_op(op_connect_tls));
|
||||||
|
|
|
@ -3,7 +3,6 @@ use super::io::{StreamResource, StreamResourceHolder};
|
||||||
use crate::op_error::OpError;
|
use crate::op_error::OpError;
|
||||||
use crate::ops::json_op;
|
use crate::ops::json_op;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use atty;
|
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use nix::sys::termios;
|
use nix::sys::termios;
|
||||||
|
|
|
@ -5,10 +5,8 @@ use crate::ops::json_op;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use crate::worker::WorkerEvent;
|
use crate::worker::WorkerEvent;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures;
|
|
||||||
use futures::channel::mpsc;
|
use futures::channel::mpsc;
|
||||||
use futures::sink::SinkExt;
|
use futures::sink::SinkExt;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
|
|
||||||
pub fn web_worker_op<D>(
|
pub fn web_worker_op<D>(
|
||||||
|
|
|
@ -12,10 +12,8 @@ use crate::web_worker::WebWorker;
|
||||||
use crate::worker::WorkerEvent;
|
use crate::worker::WorkerEvent;
|
||||||
use crate::worker::WorkerHandle;
|
use crate::worker::WorkerHandle;
|
||||||
use deno_core::*;
|
use deno_core::*;
|
||||||
use futures;
|
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use futures::future::TryFutureExt;
|
use futures::future::TryFutureExt;
|
||||||
use std;
|
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::thread::JoinHandle;
|
use std::thread::JoinHandle;
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
use crate::colors;
|
use crate::colors;
|
||||||
use crate::flags::Flags;
|
use crate::flags::Flags;
|
||||||
use crate::op_error::OpError;
|
use crate::op_error::OpError;
|
||||||
#[cfg(not(test))]
|
|
||||||
use atty;
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
use crate::deno_dir::DenoDir;
|
use crate::deno_dir::DenoDir;
|
||||||
use crate::op_error::OpError;
|
use crate::op_error::OpError;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use rustyline;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// 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
|
//! 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 deno_core::JSStackFrame;
|
||||||
use sourcemap::SourceMap;
|
use sourcemap::SourceMap;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
|
@ -22,7 +22,6 @@ use futures::future::TryFutureExt;
|
||||||
use rand::rngs::StdRng;
|
use rand::rngs::StdRng;
|
||||||
use rand::SeedableRng;
|
use rand::SeedableRng;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std;
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
use crate::fs as deno_fs;
|
use crate::fs as deno_fs;
|
||||||
use crate::installer::is_remote_url;
|
use crate::installer::is_remote_url;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use std;
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -3,7 +3,6 @@ use crate::ops;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use crate::worker::Worker;
|
use crate::worker::Worker;
|
||||||
use crate::worker::WorkerEvent;
|
use crate::worker::WorkerEvent;
|
||||||
use deno_core;
|
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::StartupData;
|
use deno_core::StartupData;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
|
|
|
@ -4,7 +4,6 @@ use crate::inspector::DenoInspector;
|
||||||
use crate::ops;
|
use crate::ops;
|
||||||
use crate::state::DebugType;
|
use crate::state::DebugType;
|
||||||
use crate::state::State;
|
use crate::state::State;
|
||||||
use deno_core;
|
|
||||||
use deno_core::Buf;
|
use deno_core::Buf;
|
||||||
use deno_core::ErrBox;
|
use deno_core::ErrBox;
|
||||||
use deno_core::ModuleId;
|
use deno_core::ModuleId;
|
||||||
|
|
|
@ -424,9 +424,8 @@ impl EsIsolate {
|
||||||
|
|
||||||
let is_main =
|
let is_main =
|
||||||
load.state == LoadState::LoadingRoot && !load.is_dynamic_import();
|
load.state == LoadState::LoadingRoot && !load.is_dynamic_import();
|
||||||
let referrer_name = &module_url_found.to_string();
|
|
||||||
let referrer_specifier =
|
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:
|
// #A There are 3 cases to handle at this moment:
|
||||||
// 1. Source code resolved result have the same module name as requested
|
// 1. Source code resolved result have the same module name as requested
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
// descriptor (hence the different name).
|
// descriptor (hence the different name).
|
||||||
|
|
||||||
use downcast_rs::Downcast;
|
use downcast_rs::Downcast;
|
||||||
use std;
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue