Skip to content

Commit

Permalink
lint clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Sep 13, 2019
1 parent 759ef99 commit 2b3c348
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cli/ops/dispatch_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,6 +55,7 @@ struct AsyncArgs {
promise_id: Option<u64>,
}

#[derive(Default)]
pub struct JsonDispatcher {
op_registry: RwLock<BTreeMap<OpId, JsonOpHandler>>,
name_registry: RwLock<BTreeMap<String, OpId>>,
Expand Down
1 change: 1 addition & 0 deletions cli/ops/dispatch_minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ fn test_parse_min_record() {
assert_eq!(parse_min_record(&buf), None);
}

#[derive(Default)]
pub struct MinimalDispatcher {
op_registry: RwLock<BTreeMap<OpId, MinimalOpHandler>>,
name_registry: RwLock<BTreeMap<String, OpId>>,
Expand Down
4 changes: 2 additions & 2 deletions cli/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2b3c348

Please sign in to comment.