From 2b3c348895162baaf8a38b2b84b2a4d162726e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 13 Sep 2019 16:24:24 +0200 Subject: [PATCH] lint clippy --- cli/ops/dispatch_json.rs | 3 ++- cli/ops/dispatch_minimal.rs | 1 + cli/ops/mod.rs | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/ops/dispatch_json.rs b/cli/ops/dispatch_json.rs index f7a09394b90085..dd141467996a1c 100644 --- a/cli/ops/dispatch_json.rs +++ b/cli/ops/dispatch_json.rs @@ -2,7 +2,7 @@ use crate::ops::*; use crate::state::ThreadSafeState; use crate::tokio_util; -use deno::*; +use deno::OpId; use futures::Future; use futures::Poll; pub use serde_derive::Deserialize; @@ -55,6 +55,7 @@ struct AsyncArgs { promise_id: Option, } +#[derive(Default)] pub struct JsonDispatcher { op_registry: RwLock>, name_registry: RwLock>, diff --git a/cli/ops/dispatch_minimal.rs b/cli/ops/dispatch_minimal.rs index 7a40410692eed9..c3868404e7b45e 100644 --- a/cli/ops/dispatch_minimal.rs +++ b/cli/ops/dispatch_minimal.rs @@ -77,6 +77,7 @@ fn test_parse_min_record() { assert_eq!(parse_min_record(&buf), None); } +#[derive(Default)] pub struct MinimalDispatcher { op_registry: RwLock>, name_registry: RwLock>, diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs index 0e98af3cfa12ca..e7d64c359966af 100644 --- a/cli/ops/mod.rs +++ b/cli/ops/mod.rs @@ -39,11 +39,11 @@ pub struct DispatchManager { impl DispatchManager { pub fn new() -> Self { - let minimal_dispatcher = MinimalDispatcher::new(); + let minimal_dispatcher = MinimalDispatcher::default(); minimal_dispatcher.register_op("read", io::op_read); minimal_dispatcher.register_op("write", io::op_write); - let json_dispatcher = JsonDispatcher::new(); + let json_dispatcher = JsonDispatcher::default(); json_dispatcher.register_op("exit", os::op_exit); json_dispatcher.register_op("is_tty", os::op_is_tty); json_dispatcher.register_op("env", os::op_env);