summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/colors.rs17
-rw-r--r--runtime/js.rs2
-rw-r--r--runtime/lib.rs5
-rw-r--r--runtime/ops/fs.rs1
-rw-r--r--runtime/ops/io.rs2
-rw-r--r--runtime/ops/net.rs2
-rw-r--r--runtime/ops/plugin.rs2
-rw-r--r--runtime/ops/worker_host.rs2
-rw-r--r--runtime/permissions.rs4
-rw-r--r--runtime/web_worker.rs2
-rw-r--r--runtime/worker.rs1
11 files changed, 17 insertions, 23 deletions
diff --git a/runtime/colors.rs b/runtime/colors.rs
index ac4643a0c..6d020bb6d 100644
--- a/runtime/colors.rs
+++ b/runtime/colors.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use regex::Regex;
use std::env;
use std::fmt;
@@ -10,15 +9,13 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
#[cfg(windows)]
use termcolor::{BufferWriter, ColorChoice};
-lazy_static! {
- // STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
- // Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
- static ref STRIP_ANSI_RE: Regex = Regex::new(
- r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
- ).unwrap();
- static ref NO_COLOR: bool = {
- env::var_os("NO_COLOR").is_some()
- };
+lazy_static::lazy_static! {
+ // STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
+ // Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
+ static ref STRIP_ANSI_RE: Regex = Regex::new(
+ r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
+ ).unwrap();
+ static ref NO_COLOR: bool = env::var_os("NO_COLOR").is_some();
}
/// Helper function to strip ansi codes.
diff --git a/runtime/js.rs b/runtime/js.rs
index d61572b21..9ad668467 100644
--- a/runtime/js.rs
+++ b/runtime/js.rs
@@ -1,6 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use deno_core::Snapshot;
+use log::debug;
pub static CLI_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.bin"));
diff --git a/runtime/lib.rs b/runtime/lib.rs
index b30f10bd1..1606e9dfe 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -2,11 +2,6 @@
#![deny(warnings)]
-#[macro_use]
-extern crate lazy_static;
-#[macro_use]
-extern crate log;
-
pub use deno_console;
pub use deno_crypto;
pub use deno_fetch;
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs
index e88aa5ba8..cb20cf471 100644
--- a/runtime/ops/fs.rs
+++ b/runtime/ops/fs.rs
@@ -17,6 +17,7 @@ use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
use deno_crypto::rand::thread_rng;
use deno_crypto::rand::Rng;
+use log::debug;
use serde::Deserialize;
use std::cell::RefCell;
use std::convert::From;
diff --git a/runtime/ops/io.rs b/runtime/ops/io.rs
index 75076f716..d87cfcf94 100644
--- a/runtime/ops/io.rs
+++ b/runtime/ops/io.rs
@@ -42,7 +42,7 @@ use tokio::net::unix;
#[cfg(windows)]
use std::os::windows::io::FromRawHandle;
-lazy_static! {
+lazy_static::lazy_static! {
/// Due to portability issues on Windows handle to stdout is created from raw
/// file descriptor. The caveat of that approach is fact that when this
/// handle is dropped underlying file descriptor is closed - that is highly
diff --git a/runtime/ops/net.rs b/runtime/ops/net.rs
index 4d335c886..6ec393bac 100644
--- a/runtime/ops/net.rs
+++ b/runtime/ops/net.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use crate::ops::io::TcpStreamResource;
use crate::permissions::Permissions;
use crate::resolve_addr::resolve_addr;
@@ -21,6 +20,7 @@ use deno_core::RcRef;
use deno_core::Resource;
use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
+use log::debug;
use serde::Deserialize;
use serde::Serialize;
use std::borrow::Cow;
diff --git a/runtime/ops/plugin.rs b/runtime/ops/plugin.rs
index bfad7c673..6952cf77f 100644
--- a/runtime/ops/plugin.rs
+++ b/runtime/ops/plugin.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use crate::metrics::metrics_op;
use crate::permissions::Permissions;
use deno_core::error::AnyError;
@@ -16,6 +15,7 @@ use deno_core::OpState;
use deno_core::Resource;
use deno_core::ZeroCopyBuf;
use dlopen::symbor::Library;
+use log::debug;
use serde::Deserialize;
use std::borrow::Cow;
use std::cell::RefCell;
diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs
index 817a4c70f..cddde985a 100644
--- a/runtime/ops/worker_host.rs
+++ b/runtime/ops/worker_host.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use crate::permissions::resolve_read_allowlist;
use crate::permissions::resolve_write_allowlist;
use crate::permissions::NetDescriptor;
@@ -28,6 +27,7 @@ use deno_core::BufVec;
use deno_core::ModuleSpecifier;
use deno_core::OpState;
use deno_core::ZeroCopyBuf;
+use log::debug;
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
diff --git a/runtime/permissions.rs b/runtime/permissions.rs
index ba150f47e..af05e69d5 100644
--- a/runtime/permissions.rs
+++ b/runtime/permissions.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use crate::colors;
use crate::fs_util::resolve_from_cwd;
use deno_core::error::custom_error;
@@ -9,6 +8,7 @@ use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::url;
use deno_core::ModuleSpecifier;
+use log::debug;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
@@ -717,7 +717,7 @@ fn permission_prompt(_message: &str) -> bool {
}
#[cfg(test)]
-lazy_static! {
+lazy_static::lazy_static! {
/// Lock this when you use `set_prompt_result` in a test case.
static ref PERMISSION_PROMPT_GUARD: Mutex<()> = Mutex::new(());
}
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 2a0f60e21..f5c81e6d4 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
use crate::colors;
use crate::inspector::DenoInspector;
use crate::inspector::InspectorServer;
@@ -24,6 +23,7 @@ use deno_core::JsRuntime;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
+use log::debug;
use std::env;
use std::rc::Rc;
use std::sync::atomic::AtomicBool;
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 51fe1dc27..00434b313 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -21,6 +21,7 @@ use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
+use log::debug;
use std::env;
use std::rc::Rc;
use std::sync::Arc;