From 256557d3ccb721840e17c7a439a6ab00cae79f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 23 May 2016 11:46:01 +0200 Subject: [PATCH] Removing warnings --- ipc/codegen/src/serialization.rs | 1 - json/src/spec/engine.rs | 2 -- util/src/io/service.rs | 3 --- util/src/keys/test_account_provider.rs | 2 +- util/src/network/discovery.rs | 1 - util/src/network/host.rs | 3 +-- util/src/network/session.rs | 9 ++++----- util/src/trie/node.rs | 9 ++++----- util/src/trie/sectriedb.rs | 1 - util/src/trie/sectriedbmut.rs | 1 - 10 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ipc/codegen/src/serialization.rs b/ipc/codegen/src/serialization.rs index 9854993c5..a249b3830 100644 --- a/ipc/codegen/src/serialization.rs +++ b/ipc/codegen/src/serialization.rs @@ -24,7 +24,6 @@ use syntax::ast::{ use syntax::ast; use syntax::codemap::Span; use syntax::ext::base::{Annotatable, ExtCtxt}; -use syntax::ext::build::AstBuilder; use syntax::ptr::P; pub struct Error; diff --git a/json/src/spec/engine.rs b/json/src/spec/engine.rs index 7d81aaa5a..e877e37a8 100644 --- a/json/src/spec/engine.rs +++ b/json/src/spec/engine.rs @@ -16,8 +16,6 @@ //! Engine deserialization. -use serde::Deserializer; -use serde::de::Visitor; use spec::Ethash; use spec::BasicAuthority; diff --git a/util/src/io/service.rs b/util/src/io/service.rs index 95aa19e47..d946463f5 100644 --- a/util/src/io/service.rs +++ b/util/src/io/service.rs @@ -18,11 +18,8 @@ use std::sync::*; use std::thread::{self, JoinHandle}; use std::collections::HashMap; use mio::*; -use hash::*; -use rlp::*; use error::*; use io::{IoError, IoHandler}; -use arrayvec::*; use crossbeam::sync::chase_lev; use io::worker::{Worker, Work, WorkType}; use panics::*; diff --git a/util/src/keys/test_account_provider.rs b/util/src/keys/test_account_provider.rs index b8aed85ce..34aa41a1a 100644 --- a/util/src/keys/test_account_provider.rs +++ b/util/src/keys/test_account_provider.rs @@ -19,7 +19,7 @@ use std::sync::RwLock; use std::collections::HashMap; use std::io; -use hash::{Address, FixedHash}; +use hash::Address; use crypto::{Secret, KeyPair}; use super::store::{AccountProvider, SigningError, EncryptedHashMapError}; diff --git a/util/src/network/discovery.rs b/util/src/network/discovery.rs index d755c58e7..d65309246 100644 --- a/util/src/network/discovery.rs +++ b/util/src/network/discovery.rs @@ -512,7 +512,6 @@ mod tests { use crypto::KeyPair; use std::str::FromStr; use rustc_serialize::hex::FromHex; - use rlp::*; #[test] fn find_node() { diff --git a/util/src/network/host.rs b/util/src/network/host.rs index 971f3a424..13b64eb3c 100644 --- a/util/src/network/host.rs +++ b/util/src/network/host.rs @@ -16,7 +16,6 @@ use std::net::{SocketAddr}; use std::collections::{HashMap}; -use std::hash::{Hasher}; use std::str::{FromStr}; use std::sync::*; use std::ops::*; @@ -897,7 +896,7 @@ impl IoHandler> for Host where Messa fn timeout(&self, io: &IoContext>, token: TimerToken) { match token { IDLE => self.maintain_network(io), - INIT_PUBLIC => self.init_public_interface(io).unwrap_or_else(|e| + INIT_PUBLIC => self.init_public_interface(io).unwrap_or_else(|e| warn!("Error initializing public interface: {:?}", e)), FIRST_SESSION ... LAST_SESSION => self.connection_timeout(token, io), FIRST_HANDSHAKE ... LAST_HANDSHAKE => self.connection_timeout(token, io), diff --git a/util/src/network/session.rs b/util/src/network/session.rs index 614b7eeb6..6c0a20a14 100644 --- a/util/src/network/session.rs +++ b/util/src/network/session.rs @@ -17,7 +17,6 @@ use std::net::SocketAddr; use std::io; use mio::*; -use hash::*; use rlp::*; use network::connection::{EncryptedConnection, Packet}; use network::handshake::Handshake; @@ -58,7 +57,7 @@ pub enum SessionData { data: Vec, /// Packet protocol ID protocol: &'static str, - /// Zero based packet ID + /// Zero based packet ID packet_id: u8, }, } @@ -111,7 +110,7 @@ const PACKET_USER: u8 = 0x10; const PACKET_LAST: u8 = 0x7f; impl Session { - /// Create a new session out of comepleted handshake. This clones the handshake connection object + /// Create a new session out of comepleted handshake. This clones the handshake connection object /// and leaves the handhsake in limbo to be deregistered from the event loop. pub fn new(h: &mut Handshake, host: &HostInfo) -> Result { let id = h.id.clone(); @@ -159,7 +158,7 @@ impl Session { pub fn done(&self) -> bool { self.expired() && !self.connection.is_sending() } - /// Replace socket token + /// Replace socket token pub fn set_token(&mut self, token: StreamToken) { self.connection.set_token(token); } @@ -172,7 +171,7 @@ impl Session { /// Readable IO handler. Returns packet data if available. pub fn readable(&mut self, io: &IoContext, host: &HostInfo) -> Result where Message: Send + Sync + Clone { if self.expired() { - return Ok(SessionData::None) + return Ok(SessionData::None) } match try!(self.connection.readable(io)) { Some(data) => Ok(try!(self.read_packet(data, host))), diff --git a/util/src/trie/node.rs b/util/src/trie/node.rs index 2ebcd0ef0..8f9351d05 100644 --- a/util/src/trie/node.rs +++ b/util/src/trie/node.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -use hash::*; use nibbleslice::*; use bytes::*; use rlp::*; @@ -34,14 +33,14 @@ pub enum Node<'a> { } impl<'a> Node<'a> { - /// Decode the `node_rlp` and return the Node. + /// Decode the `node_rlp` and return the Node. pub fn decoded(node_rlp: &'a [u8]) -> Node<'a> { let r = Rlp::new(node_rlp); match r.prototype() { - // either leaf or extension - decode first item with NibbleSlice::??? + // either leaf or extension - decode first item with NibbleSlice::??? // and use is_leaf return to figure out which. // if leaf, second item is a value (is_data()) - // if extension, second item is a node (either SHA3 to be looked up and + // if extension, second item is a node (either SHA3 to be looked up and // fed back into this function or inline RLP which can be fed back into this function). Prototype::List(2) => match NibbleSlice::from_encoded(r.at(0).data()) { (slice, true) => Node::Leaf(slice, r.at(1).data()), @@ -100,7 +99,7 @@ impl<'a> Node<'a> { } /// Encode the node, adding it to `journal` if necessary and return the RLP valid for - /// insertion into a parent node. + /// insertion into a parent node. pub fn encoded_and_added(&self, journal: &mut Journal) -> Bytes { let mut stream = RlpStream::new(); match *self { diff --git a/util/src/trie/sectriedb.rs b/util/src/trie/sectriedb.rs index 3e74f8655..685af335b 100644 --- a/util/src/trie/sectriedb.rs +++ b/util/src/trie/sectriedb.rs @@ -17,7 +17,6 @@ use hash::*; use sha3::*; use hashdb::*; -use rlp::*; use super::triedb::*; use super::trietraits::*; diff --git a/util/src/trie/sectriedbmut.rs b/util/src/trie/sectriedbmut.rs index 7e17610f8..895a821c9 100644 --- a/util/src/trie/sectriedbmut.rs +++ b/util/src/trie/sectriedbmut.rs @@ -17,7 +17,6 @@ use hash::*; use sha3::*; use hashdb::*; -use rlp::*; use super::triedbmut::*; use super::trietraits::*;