From 8e26977693a1513fad75a85b310bdf88c9e6774d Mon Sep 17 00:00:00 2001 From: NikVolf Date: Sat, 16 Jul 2016 18:51:06 +0200 Subject: [PATCH] review fixes --- ipc/codegen/src/codegen.rs | 1 - parity/sync/main.rs | 17 ++++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ipc/codegen/src/codegen.rs b/ipc/codegen/src/codegen.rs index a2fa0ee49..dcc3082d0 100644 --- a/ipc/codegen/src/codegen.rs +++ b/ipc/codegen/src/codegen.rs @@ -19,7 +19,6 @@ use syntax::ast::{ MetaItem, Item, ImplItemKind, - ImplItem, MethodSig, Arg, PatKind, diff --git a/parity/sync/main.rs b/parity/sync/main.rs index 8b98bdcb6..1e6af664b 100644 --- a/parity/sync/main.rs +++ b/parity/sync/main.rs @@ -30,14 +30,14 @@ extern crate ethcore_util as util; use std::sync::Arc; use hypervisor::{HypervisorServiceClient, SYNC_MODULE_ID, HYPERVISOR_IPC_URL}; use ctrlc::CtrlC; -use std::sync::atomic::*; +use std::sync::atomic::{AtomicBool, Ordering}; use docopt::Docopt; use ethcore::client::{RemoteClient, ChainNotify}; -use nanoipc::*; use ethsync::{SyncProvider, SyncConfig, EthSync, ManageNetwork, NetworkConfiguration}; use std::thread; -use util::numbers::*; +use util::numbers::{U256, H256}; use std::str::FromStr; +use nanoipc::IpcInterface; const USAGE: &'static str = " Ethcore sync service @@ -92,11 +92,10 @@ impl Args { } } -fn run_service(addr: &str, stop_guard: Arc, service: &Arc) where Arc: IpcInterface { +fn run_service(addr: &str, stop_guard: Arc, service: Arc) where Arc: IpcInterface { let socket_url = addr.to_owned(); - let service_spawn = service.clone(); std::thread::spawn(move || { - let mut worker = nanoipc::Worker::::new(&service_spawn); + let mut worker = nanoipc::Worker::::new(&service); worker.add_reqrep(&socket_url).unwrap(); while !stop_guard.load(Ordering::Relaxed) { @@ -117,9 +116,9 @@ fn main() { let stop = Arc::new(AtomicBool::new(false)); let sync = EthSync::new(sync_config, remote_client.clone(), network_config).unwrap(); - run_service("ipc:///tmp/parity-sync.ipc", stop.clone(), &(sync.clone() as Arc)); - run_service("ipc:///tmp/parity-manage-net.ipc", stop.clone(), &(sync.clone() as Arc)); - run_service("ipc:///tmp/parity-sync-notify.ipc", stop.clone(), &(sync.clone() as Arc)); + run_service("ipc:///tmp/parity-sync.ipc", stop.clone(), sync.clone() as Arc); + run_service("ipc:///tmp/parity-manage-net.ipc", stop.clone(), sync.clone() as Arc); + run_service("ipc:///tmp/parity-sync-notify.ipc", stop.clone(), sync.clone() as Arc); let hypervisor_client = nanoipc::init_client::>(HYPERVISOR_IPC_URL).unwrap(); hypervisor_client.handshake().unwrap();