From da7b30628b310e4247481e03170bb9a46c4e0d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 20 Jun 2016 15:20:55 +0200 Subject: [PATCH] Fixing warnings --- ethcore/src/account_provider.rs | 1 - parity/configuration.rs | 7 ++++--- parity/io_handler.rs | 5 ++--- parity/main.rs | 2 +- util/src/network/host.rs | 9 +++------ 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ethcore/src/account_provider.rs b/ethcore/src/account_provider.rs index 3c79cfd52..6744c6bd2 100644 --- a/ethcore/src/account_provider.rs +++ b/ethcore/src/account_provider.rs @@ -236,7 +236,6 @@ impl AccountProvider { #[cfg(test)] mod tests { use super::AccountProvider; - use ethstore::SecretStore; use ethstore::ethkey::{Generator, Random}; #[test] diff --git a/parity/configuration.rs b/parity/configuration.rs index 7c42f06e1..967a07a07 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -263,9 +263,10 @@ impl Configuration { }).collect::>(); if !self.args.flag_no_import_keys { - let dir_type = match self.args.flag_testnet { - true => DirectoryType::Testnet, - false => DirectoryType::Main, + let dir_type = if self.args.flag_testnet { + DirectoryType::Testnet + } else { + DirectoryType::Main }; let from = GethDirectory::open(dir_type); diff --git a/parity/io_handler.rs b/parity/io_handler.rs index a94582b1d..3f0c04fbd 100644 --- a/parity/io_handler.rs +++ b/parity/io_handler.rs @@ -39,9 +39,8 @@ impl IoHandler for ClientIoHandler { } fn timeout(&self, _io: &IoContext, timer: TimerToken) { - match timer { - INFO_TIMER => { self.info.tick(&self.client, Some(&self.sync)); } - _ => {} + if let INFO_TIMER = timer { + self.info.tick(&self.client, Some(&self.sync)); } } diff --git a/parity/main.rs b/parity/main.rs index 9b3698c5c..1397de8c7 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -485,7 +485,7 @@ fn execute_signer(conf: Configuration) { } fn execute_account_cli(conf: Configuration) { - use ethcore::ethstore::{SecretStore, EthStore, import_accounts}; + use ethcore::ethstore::{EthStore, import_accounts}; use ethcore::ethstore::dir::DiskDirectory; use ethcore::account_provider::AccountProvider; use rpassword::read_password; diff --git a/util/src/network/host.rs b/util/src/network/host.rs index aef56fc09..92d6a77ae 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -663,13 +663,10 @@ impl Host where Message: Send + Sync + Clone { match s.readable(io, &self.info.read().unwrap()) { Err(e) => { trace!(target: "network", "Session read error: {}:{:?} ({:?}) {:?}", token, s.id(), s.remote_addr(), e); - match e { - UtilError::Network(NetworkError::Disconnect(DisconnectReason::IncompatibleProtocol)) => { - if let Some(id) = s.id() { - self.nodes.write().unwrap().mark_as_useless(id); - } + if let UtilError::Network(NetworkError::Disconnect(DisconnectReason::IncompatibleProtocol)) = e { + if let Some(id) = s.id() { + self.nodes.write().unwrap().mark_as_useless(id); } - _ => (), } kill = true; break;