Merge pull request #1125 from ethcore/warnings
Fixing unused imports warnings
This commit is contained in:
commit
31b6b59f20
@ -24,7 +24,6 @@ use syntax::ast::{
|
|||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::codemap::Span;
|
use syntax::codemap::Span;
|
||||||
use syntax::ext::base::{Annotatable, ExtCtxt};
|
use syntax::ext::base::{Annotatable, ExtCtxt};
|
||||||
use syntax::ext::build::AstBuilder;
|
|
||||||
use syntax::ptr::P;
|
use syntax::ptr::P;
|
||||||
|
|
||||||
pub struct Error;
|
pub struct Error;
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
//! Engine deserialization.
|
//! Engine deserialization.
|
||||||
|
|
||||||
use serde::Deserializer;
|
|
||||||
use serde::de::Visitor;
|
|
||||||
use spec::Ethash;
|
use spec::Ethash;
|
||||||
use spec::BasicAuthority;
|
use spec::BasicAuthority;
|
||||||
|
|
||||||
|
@ -18,11 +18,8 @@ use std::sync::*;
|
|||||||
use std::thread::{self, JoinHandle};
|
use std::thread::{self, JoinHandle};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use mio::*;
|
use mio::*;
|
||||||
use hash::*;
|
|
||||||
use rlp::*;
|
|
||||||
use error::*;
|
use error::*;
|
||||||
use io::{IoError, IoHandler};
|
use io::{IoError, IoHandler};
|
||||||
use arrayvec::*;
|
|
||||||
use crossbeam::sync::chase_lev;
|
use crossbeam::sync::chase_lev;
|
||||||
use io::worker::{Worker, Work, WorkType};
|
use io::worker::{Worker, Work, WorkType};
|
||||||
use panics::*;
|
use panics::*;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io;
|
use std::io;
|
||||||
use hash::{Address, FixedHash};
|
use hash::Address;
|
||||||
use crypto::{Secret, KeyPair};
|
use crypto::{Secret, KeyPair};
|
||||||
use super::store::{AccountProvider, SigningError, EncryptedHashMapError};
|
use super::store::{AccountProvider, SigningError, EncryptedHashMapError};
|
||||||
|
|
||||||
|
@ -512,7 +512,6 @@ mod tests {
|
|||||||
use crypto::KeyPair;
|
use crypto::KeyPair;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use rustc_serialize::hex::FromHex;
|
use rustc_serialize::hex::FromHex;
|
||||||
use rlp::*;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn find_node() {
|
fn find_node() {
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
use std::net::{SocketAddr};
|
use std::net::{SocketAddr};
|
||||||
use std::collections::{HashMap};
|
use std::collections::{HashMap};
|
||||||
use std::hash::{Hasher};
|
|
||||||
use std::str::{FromStr};
|
use std::str::{FromStr};
|
||||||
use std::sync::*;
|
use std::sync::*;
|
||||||
use std::ops::*;
|
use std::ops::*;
|
||||||
@ -897,7 +896,7 @@ impl<Message> IoHandler<NetworkIoMessage<Message>> for Host<Message> where Messa
|
|||||||
fn timeout(&self, io: &IoContext<NetworkIoMessage<Message>>, token: TimerToken) {
|
fn timeout(&self, io: &IoContext<NetworkIoMessage<Message>>, token: TimerToken) {
|
||||||
match token {
|
match token {
|
||||||
IDLE => self.maintain_network(io),
|
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)),
|
warn!("Error initializing public interface: {:?}", e)),
|
||||||
FIRST_SESSION ... LAST_SESSION => self.connection_timeout(token, io),
|
FIRST_SESSION ... LAST_SESSION => self.connection_timeout(token, io),
|
||||||
FIRST_HANDSHAKE ... LAST_HANDSHAKE => self.connection_timeout(token, io),
|
FIRST_HANDSHAKE ... LAST_HANDSHAKE => self.connection_timeout(token, io),
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::io;
|
use std::io;
|
||||||
use mio::*;
|
use mio::*;
|
||||||
use hash::*;
|
|
||||||
use rlp::*;
|
use rlp::*;
|
||||||
use network::connection::{EncryptedConnection, Packet};
|
use network::connection::{EncryptedConnection, Packet};
|
||||||
use network::handshake::Handshake;
|
use network::handshake::Handshake;
|
||||||
@ -58,7 +57,7 @@ pub enum SessionData {
|
|||||||
data: Vec<u8>,
|
data: Vec<u8>,
|
||||||
/// Packet protocol ID
|
/// Packet protocol ID
|
||||||
protocol: &'static str,
|
protocol: &'static str,
|
||||||
/// Zero based packet ID
|
/// Zero based packet ID
|
||||||
packet_id: u8,
|
packet_id: u8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -111,7 +110,7 @@ const PACKET_USER: u8 = 0x10;
|
|||||||
const PACKET_LAST: u8 = 0x7f;
|
const PACKET_LAST: u8 = 0x7f;
|
||||||
|
|
||||||
impl Session {
|
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.
|
/// and leaves the handhsake in limbo to be deregistered from the event loop.
|
||||||
pub fn new(h: &mut Handshake, host: &HostInfo) -> Result<Session, UtilError> {
|
pub fn new(h: &mut Handshake, host: &HostInfo) -> Result<Session, UtilError> {
|
||||||
let id = h.id.clone();
|
let id = h.id.clone();
|
||||||
@ -159,7 +158,7 @@ impl Session {
|
|||||||
pub fn done(&self) -> bool {
|
pub fn done(&self) -> bool {
|
||||||
self.expired() && !self.connection.is_sending()
|
self.expired() && !self.connection.is_sending()
|
||||||
}
|
}
|
||||||
/// Replace socket token
|
/// Replace socket token
|
||||||
pub fn set_token(&mut self, token: StreamToken) {
|
pub fn set_token(&mut self, token: StreamToken) {
|
||||||
self.connection.set_token(token);
|
self.connection.set_token(token);
|
||||||
}
|
}
|
||||||
@ -172,7 +171,7 @@ impl Session {
|
|||||||
/// Readable IO handler. Returns packet data if available.
|
/// Readable IO handler. Returns packet data if available.
|
||||||
pub fn readable<Message>(&mut self, io: &IoContext<Message>, host: &HostInfo) -> Result<SessionData, UtilError> where Message: Send + Sync + Clone {
|
pub fn readable<Message>(&mut self, io: &IoContext<Message>, host: &HostInfo) -> Result<SessionData, UtilError> where Message: Send + Sync + Clone {
|
||||||
if self.expired() {
|
if self.expired() {
|
||||||
return Ok(SessionData::None)
|
return Ok(SessionData::None)
|
||||||
}
|
}
|
||||||
match try!(self.connection.readable(io)) {
|
match try!(self.connection.readable(io)) {
|
||||||
Some(data) => Ok(try!(self.read_packet(data, host))),
|
Some(data) => Ok(try!(self.read_packet(data, host))),
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use hash::*;
|
|
||||||
use nibbleslice::*;
|
use nibbleslice::*;
|
||||||
use bytes::*;
|
use bytes::*;
|
||||||
use rlp::*;
|
use rlp::*;
|
||||||
@ -34,14 +33,14 @@ pub enum Node<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> 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> {
|
pub fn decoded(node_rlp: &'a [u8]) -> Node<'a> {
|
||||||
let r = Rlp::new(node_rlp);
|
let r = Rlp::new(node_rlp);
|
||||||
match r.prototype() {
|
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.
|
// and use is_leaf return to figure out which.
|
||||||
// if leaf, second item is a value (is_data())
|
// 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).
|
// 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()) {
|
Prototype::List(2) => match NibbleSlice::from_encoded(r.at(0).data()) {
|
||||||
(slice, true) => Node::Leaf(slice, r.at(1).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
|
/// 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 {
|
pub fn encoded_and_added(&self, journal: &mut Journal) -> Bytes {
|
||||||
let mut stream = RlpStream::new();
|
let mut stream = RlpStream::new();
|
||||||
match *self {
|
match *self {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
use hash::*;
|
use hash::*;
|
||||||
use sha3::*;
|
use sha3::*;
|
||||||
use hashdb::*;
|
use hashdb::*;
|
||||||
use rlp::*;
|
|
||||||
use super::triedb::*;
|
use super::triedb::*;
|
||||||
use super::trietraits::*;
|
use super::trietraits::*;
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
use hash::*;
|
use hash::*;
|
||||||
use sha3::*;
|
use sha3::*;
|
||||||
use hashdb::*;
|
use hashdb::*;
|
||||||
use rlp::*;
|
|
||||||
use super::triedbmut::*;
|
use super::triedbmut::*;
|
||||||
use super::trietraits::*;
|
use super::trietraits::*;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user