summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bindings.rs7
-rw-r--r--core/examples/http_bench_bin_ops.rs14
-rw-r--r--core/examples/http_bench_json_ops.rs14
-rw-r--r--core/gotham_state.rs1
-rw-r--r--core/lib.rs6
-rw-r--r--core/modules.rs2
-rw-r--r--core/runtime.rs1
-rw-r--r--core/shared_queue.rs1
8 files changed, 17 insertions, 29 deletions
diff --git a/core/bindings.rs b/core/bindings.rs
index afa4fbbf3..4665803be 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -9,6 +9,8 @@ use crate::OpTable;
use crate::ZeroCopyBuf;
use futures::future::FutureExt;
use rusty_v8 as v8;
+use serde::Serialize;
+use serde_v8::to_v8;
use std::cell::Cell;
use std::convert::TryFrom;
use std::convert::TryInto;
@@ -17,10 +19,7 @@ use std::option::Option;
use url::Url;
use v8::MapFnTo;
-use serde::Serialize;
-use serde_v8::to_v8;
-
-lazy_static! {
+lazy_static::lazy_static! {
pub static ref EXTERNAL_REFERENCES: v8::ExternalReferences =
v8::ExternalReferences::new(&[
v8::ExternalReference {
diff --git a/core/examples/http_bench_bin_ops.rs b/core/examples/http_bench_bin_ops.rs
index 1f649b235..371ec60c3 100644
--- a/core/examples/http_bench_bin_ops.rs
+++ b/core/examples/http_bench_bin_ops.rs
@@ -1,8 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
-#[macro_use]
-extern crate log;
-
use deno_core::error::bad_resource_id;
use deno_core::error::AnyError;
use deno_core::AsyncRefCell;
@@ -128,7 +124,7 @@ fn op_listen(
_rid: ResourceId,
_bufs: &mut [ZeroCopyBuf],
) -> Result<u32, AnyError> {
- debug!("listen");
+ log::debug!("listen");
let addr = "127.0.0.1:4544".parse::<SocketAddr>().unwrap();
let std_listener = std::net::TcpListener::bind(&addr)?;
std_listener.set_nonblocking(true)?;
@@ -142,7 +138,7 @@ fn op_close(
rid: ResourceId,
_bufs: &mut [ZeroCopyBuf],
) -> Result<u32, AnyError> {
- debug!("close rid={}", rid);
+ log::debug!("close rid={}", rid);
state
.resource_table
.close(rid)
@@ -155,7 +151,7 @@ async fn op_accept(
rid: ResourceId,
_bufs: BufVec,
) -> Result<u32, AnyError> {
- debug!("accept rid={}", rid);
+ log::debug!("accept rid={}", rid);
let listener = state
.borrow()
@@ -173,7 +169,7 @@ async fn op_read(
mut bufs: BufVec,
) -> Result<u32, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
- debug!("read rid={}", rid);
+ log::debug!("read rid={}", rid);
let stream = state
.borrow()
@@ -190,7 +186,7 @@ async fn op_write(
bufs: BufVec,
) -> Result<u32, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
- debug!("write rid={}", rid);
+ log::debug!("write rid={}", rid);
let stream = state
.borrow()
diff --git a/core/examples/http_bench_json_ops.rs b/core/examples/http_bench_json_ops.rs
index c24175747..bc96ce478 100644
--- a/core/examples/http_bench_json_ops.rs
+++ b/core/examples/http_bench_json_ops.rs
@@ -1,8 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
-#[macro_use]
-extern crate log;
-
use deno_core::error::bad_resource_id;
use deno_core::error::AnyError;
use deno_core::AsyncRefCell;
@@ -135,7 +131,7 @@ fn op_listen(
_args: (),
_bufs: &mut [ZeroCopyBuf],
) -> Result<ResourceId, AnyError> {
- debug!("listen");
+ log::debug!("listen");
let addr = "127.0.0.1:4544".parse::<SocketAddr>().unwrap();
let std_listener = std::net::TcpListener::bind(&addr)?;
std_listener.set_nonblocking(true)?;
@@ -149,7 +145,7 @@ fn op_close(
args: ResourceId,
_buf: &mut [ZeroCopyBuf],
) -> Result<(), AnyError> {
- debug!("close rid={}", args.rid);
+ log::debug!("close rid={}", args.rid);
state
.resource_table
.close(args.rid)
@@ -162,7 +158,7 @@ async fn op_accept(
args: ResourceId,
_bufs: BufVec,
) -> Result<ResourceId, AnyError> {
- debug!("accept rid={}", args.rid);
+ log::debug!("accept rid={}", args.rid);
let listener = state
.borrow()
@@ -180,7 +176,7 @@ async fn op_read(
mut bufs: BufVec,
) -> Result<Value, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
- debug!("read rid={}", args.rid);
+ log::debug!("read rid={}", args.rid);
let stream = state
.borrow()
@@ -197,7 +193,7 @@ async fn op_write(
bufs: BufVec,
) -> Result<Value, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
- debug!("write rid={}", args.rid);
+ log::debug!("write rid={}", args.rid);
let stream = state
.borrow()
diff --git a/core/gotham_state.rs b/core/gotham_state.rs
index 04213f977..fa22878bb 100644
--- a/core/gotham_state.rs
+++ b/core/gotham_state.rs
@@ -3,6 +3,7 @@
// https://github.com/gotham-rs/gotham/blob/bcbbf8923789e341b7a0e62c59909428ca4e22e2/gotham/src/state/mod.rs
// Copyright 2017 Gotham Project Developers. MIT license.
+use log::trace;
use std::any::Any;
use std::any::TypeId;
use std::collections::HashMap;
diff --git a/core/lib.rs b/core/lib.rs
index c65ed7aac..ea6968b60 100644
--- a/core/lib.rs
+++ b/core/lib.rs
@@ -1,10 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-
-#[macro_use]
-extern crate lazy_static;
-#[macro_use]
-extern crate log;
-
mod async_cancel;
mod async_cell;
mod bindings;
diff --git a/core/modules.rs b/core/modules.rs
index b9b99d3b5..8c193bf5b 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -21,7 +21,7 @@ use std::sync::atomic::Ordering;
use std::task::Context;
use std::task::Poll;
-lazy_static! {
+lazy_static::lazy_static! {
pub static ref NEXT_LOAD_ID: AtomicI32 = AtomicI32::new(0);
}
diff --git a/core/runtime.rs b/core/runtime.rs
index 9fa626636..80fe90d2f 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -31,6 +31,7 @@ use futures::stream::StreamExt;
use futures::stream::StreamFuture;
use futures::task::AtomicWaker;
use futures::Future;
+use log::debug;
use std::any::Any;
use std::cell::RefCell;
use std::collections::HashMap;
diff --git a/core/shared_queue.rs b/core/shared_queue.rs
index 69d355e95..dda54a4df 100644
--- a/core/shared_queue.rs
+++ b/core/shared_queue.rs
@@ -18,6 +18,7 @@ SharedQueue Binary Layout
use crate::bindings;
use crate::ops::OpId;
+use log::debug;
use rusty_v8 as v8;
use std::convert::TryInto;