From 7ac985dded160651be55e5e4e0c786089f0dc1ef Mon Sep 17 00:00:00 2001 From: NikVolf Date: Thu, 14 Apr 2016 20:56:06 +0300 Subject: [PATCH] fix warnings --- parity/hypervisor/mod.rs | 9 ++++++--- parity/hypervisor/service.rs.in | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/parity/hypervisor/mod.rs b/parity/hypervisor/mod.rs index d22585334..c5a1514ff 100644 --- a/parity/hypervisor/mod.rs +++ b/parity/hypervisor/mod.rs @@ -16,6 +16,9 @@ //! Parity interprocess hypervisor module +// while not in binary +#![allow(dead_code)] + pub mod service; pub const HYPERVISOR_IPC_URL: &'static str = "ipc:///tmp/parity-internal-hyper-status.ipc"; @@ -23,7 +26,6 @@ pub const HYPERVISOR_IPC_URL: &'static str = "ipc:///tmp/parity-internal-hyper-s use nanoipc; use std::sync::{Arc,RwLock}; use hypervisor::service::*; -use ipc::IpcInterface; pub struct Hypervisor { service: Arc, @@ -42,7 +44,7 @@ impl Hypervisor { fn with_url_and_service(addr: &str, service: Arc) -> Arc { let mut worker = nanoipc::Worker::new(&service); - worker.add_reqrep(addr); + worker.add_reqrep(addr).expect("Hypervisor ipc worker can not start - critical!"); Arc::new(Hypervisor{ service: service, @@ -73,8 +75,9 @@ mod tests { #[test] fn can_init() { let url = "ipc:///tmp/test-parity-hypervisor-10.ipc"; + let test_module_id = 8080u64; - let hypervisor = Hypervisor::with_url(url); + let hypervisor = Hypervisor::with_url_and_service(url, HypervisorService::with_modules(vec![test_module_id])); assert_eq!(false, hypervisor.modules_ready()); } diff --git a/parity/hypervisor/service.rs.in b/parity/hypervisor/service.rs.in index f0cd4de2a..fa5121d49 100644 --- a/parity/hypervisor/service.rs.in +++ b/parity/hypervisor/service.rs.in @@ -21,8 +21,8 @@ use std::collections::HashMap; pub type IpcModuleId = u64; -pub const DATABASE_MODULE_ID: IpcModuleId = 1000; -pub const BLOCKCHAIN_MODULE_ID: IpcModuleId = 2000; +pub const _DATABASE_MODULE_ID: IpcModuleId = 1000; +pub const _BLOCKCHAIN_MODULE_ID: IpcModuleId = 2000; pub struct HypervisorService { check_list: RwLock>, @@ -39,7 +39,7 @@ impl HypervisorService { impl HypervisorService { pub fn new() -> Arc { - HypervisorService::with_modules(vec![DATABASE_MODULE_ID]) + HypervisorService::with_modules(vec![]) } pub fn with_modules(module_ids: Vec) -> Arc {