Bumping clippy & fixing warnings (#1024)
* Bumping clippy * Fixing warnings found by clippy
This commit is contained in:
parent
7c2adc4137
commit
e2465b1eab
16
Cargo.lock
generated
16
Cargo.lock
generated
@ -3,7 +3,7 @@ name = "parity"
|
|||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bincode 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ctrlc 1.1.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)",
|
"ctrlc 1.1.1 (git+https://github.com/tomusdrw/rust-ctrlc.git)",
|
||||||
"daemonize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"daemonize 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
"docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -136,7 +136,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clippy"
|
name = "clippy"
|
||||||
version = "0.0.63"
|
version = "0.0.64"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quine-mc_cluskey 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quine-mc_cluskey 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -252,7 +252,7 @@ name = "ethcore"
|
|||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 1.1.0",
|
"ethash 1.1.0",
|
||||||
@ -310,7 +310,7 @@ dependencies = [
|
|||||||
name = "ethcore-rpc"
|
name = "ethcore-rpc"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 1.1.0",
|
"ethash 1.1.0",
|
||||||
"ethcore 1.1.0",
|
"ethcore 1.1.0",
|
||||||
"ethcore-util 1.1.0",
|
"ethcore-util 1.1.0",
|
||||||
@ -334,7 +334,7 @@ dependencies = [
|
|||||||
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bigint 0.1.0",
|
"bigint 0.1.0",
|
||||||
"chrono 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
"chrono 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -366,7 +366,7 @@ dependencies = [
|
|||||||
name = "ethcore-webapp"
|
name = "ethcore-webapp"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore-rpc 1.1.0",
|
"ethcore-rpc 1.1.0",
|
||||||
"ethcore-util 1.1.0",
|
"ethcore-util 1.1.0",
|
||||||
"hyper 0.9.0-mio (git+https://github.com/hyperium/hyper?branch=mio)",
|
"hyper 0.9.0-mio (git+https://github.com/hyperium/hyper?branch=mio)",
|
||||||
@ -394,7 +394,7 @@ dependencies = [
|
|||||||
name = "ethminer"
|
name = "ethminer"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 1.1.0",
|
"ethcore 1.1.0",
|
||||||
"ethcore-util 1.1.0",
|
"ethcore-util 1.1.0",
|
||||||
@ -408,7 +408,7 @@ dependencies = [
|
|||||||
name = "ethsync"
|
name = "ethsync"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clippy 0.0.63 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clippy 0.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethcore 1.1.0",
|
"ethcore 1.1.0",
|
||||||
"ethcore-util 1.1.0",
|
"ethcore-util 1.1.0",
|
||||||
|
@ -23,7 +23,7 @@ daemonize = "0.2"
|
|||||||
num_cpus = "0.2"
|
num_cpus = "0.2"
|
||||||
number_prefix = "0.2"
|
number_prefix = "0.2"
|
||||||
rpassword = "0.2.1"
|
rpassword = "0.2.1"
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
ethcore = { path = "ethcore" }
|
ethcore = { path = "ethcore" }
|
||||||
ethcore-util = { path = "util" }
|
ethcore-util = { path = "util" }
|
||||||
ethsync = { path = "sync" }
|
ethsync = { path = "sync" }
|
||||||
|
@ -17,7 +17,7 @@ ethcore-util = { path = "../util" }
|
|||||||
evmjit = { path = "../evmjit", optional = true }
|
evmjit = { path = "../evmjit", optional = true }
|
||||||
ethash = { path = "../ethash" }
|
ethash = { path = "../ethash" }
|
||||||
num_cpus = "0.2"
|
num_cpus = "0.2"
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
crossbeam = "0.1.5"
|
crossbeam = "0.1.5"
|
||||||
lazy_static = "0.1"
|
lazy_static = "0.1"
|
||||||
ethcore-devtools = { path = "../devtools" }
|
ethcore-devtools = { path = "../devtools" }
|
||||||
|
@ -26,7 +26,7 @@ use crossbeam;
|
|||||||
|
|
||||||
/// Max depth to avoid stack overflow (when it's reached we start a new thread with VM)
|
/// Max depth to avoid stack overflow (when it's reached we start a new thread with VM)
|
||||||
/// TODO [todr] We probably need some more sophisticated calculations here (limit on my machine 132)
|
/// TODO [todr] We probably need some more sophisticated calculations here (limit on my machine 132)
|
||||||
/// Maybe something like here: https://github.com/ethereum/libethereum/blob/4db169b8504f2b87f7d5a481819cfb959fc65f6c/libethereum/ExtVM.cpp
|
/// Maybe something like here: `https://github.com/ethereum/libethereum/blob/4db169b8504f2b87f7d5a481819cfb959fc65f6c/libethereum/ExtVM.cpp`
|
||||||
const MAX_VM_DEPTH_FOR_THREAD: usize = 64;
|
const MAX_VM_DEPTH_FOR_THREAD: usize = 64;
|
||||||
|
|
||||||
/// Returns new address created from address and given nonce.
|
/// Returns new address created from address and given nonce.
|
||||||
|
@ -87,7 +87,7 @@ impl Encodable for BlockTracesBloomGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents BloomGroup position in database.
|
/// Represents `BloomGroup` position in database.
|
||||||
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
|
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
|
||||||
pub struct TraceGroupPosition {
|
pub struct TraceGroupPosition {
|
||||||
/// Bloom level.
|
/// Bloom level.
|
||||||
|
@ -33,6 +33,7 @@ use super::flat::{FlatTrace, FlatBlockTraces, FlatTransactionTraces};
|
|||||||
const TRACE_DB_VER: &'static [u8] = b"1.0";
|
const TRACE_DB_VER: &'static [u8] = b"1.0";
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
|
#[cfg_attr(feature="dev", allow(enum_variant_names))]
|
||||||
enum TraceDBIndex {
|
enum TraceDBIndex {
|
||||||
/// Block traces index.
|
/// Block traces index.
|
||||||
BlockTraces = 0,
|
BlockTraces = 0,
|
||||||
|
@ -88,7 +88,7 @@ pub trait Tracer: Send {
|
|||||||
fn traces(self) -> Vec<Trace>;
|
fn traces(self) -> Vec<Trace>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// DbExtras provides an interface to query extra data which is not stored in tracesdb,
|
/// `DbExtras` provides an interface to query extra data which is not stored in tracesdb,
|
||||||
/// but necessary to work correctly.
|
/// but necessary to work correctly.
|
||||||
pub trait DatabaseExtras {
|
pub trait DatabaseExtras {
|
||||||
/// Returns hash of given block number.
|
/// Returns hash of given block number.
|
||||||
|
@ -10,7 +10,7 @@ rustc-serialize = "0.3"
|
|||||||
serde = "0.7.0"
|
serde = "0.7.0"
|
||||||
serde_json = "0.7.0"
|
serde_json = "0.7.0"
|
||||||
serde_macros = { version = "0.7.0", optional = true }
|
serde_macros = { version = "0.7.0", optional = true }
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_codegen = { version = "0.7.0", optional = true }
|
serde_codegen = { version = "0.7.0", optional = true }
|
||||||
|
@ -17,7 +17,7 @@ log = "0.3"
|
|||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
rayon = "0.3.1"
|
rayon = "0.3.1"
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
@ -205,9 +205,9 @@ impl MinerService for Miner {
|
|||||||
let last_hashes = chain.last_hashes();
|
let last_hashes = chain.last_hashes();
|
||||||
let env_info = EnvInfo {
|
let env_info = EnvInfo {
|
||||||
number: header.number(),
|
number: header.number(),
|
||||||
author: header.author().clone(),
|
author: *header.author(),
|
||||||
timestamp: header.timestamp(),
|
timestamp: header.timestamp(),
|
||||||
difficulty: header.difficulty().clone(),
|
difficulty: *header.difficulty(),
|
||||||
last_hashes: last_hashes,
|
last_hashes: last_hashes,
|
||||||
gas_used: U256::zero(),
|
gas_used: U256::zero(),
|
||||||
gas_limit: U256::max_value(),
|
gas_limit: U256::max_value(),
|
||||||
|
@ -22,7 +22,7 @@ ethminer = { path = "../miner" }
|
|||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
transient-hashmap = "0.1"
|
transient-hashmap = "0.1"
|
||||||
serde_macros = { version = "0.7.0", optional = true }
|
serde_macros = { version = "0.7.0", optional = true }
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_codegen = { version = "0.7.0", optional = true }
|
serde_codegen = { version = "0.7.0", optional = true }
|
||||||
|
@ -10,7 +10,7 @@ authors = ["Ethcore <admin@ethcore.io"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
ethcore-util = { path = "../util" }
|
ethcore-util = { path = "../util" }
|
||||||
ethcore = { path = "../ethcore" }
|
ethcore = { path = "../ethcore" }
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
ethminer = { path = "../miner" }
|
ethminer = { path = "../miner" }
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
/// Start with out best block and request headers from peer backwards until a common block is found
|
/// Start with out best block and request headers from peer backwards until a common block is found
|
||||||
/// 3. Download headers and block bodies from peers in parallel.
|
/// 3. Download headers and block bodies from peers in parallel.
|
||||||
/// As soon as a set of the blocks is fully downloaded at the head of the queue it is fed to the blockchain
|
/// As soon as a set of the blocks is fully downloaded at the head of the queue it is fed to the blockchain
|
||||||
/// 4. Maintain sync by handling NewBlocks/NewHashes messages
|
/// 4. Maintain sync by handling `NewBlocks/NewHashes` messages
|
||||||
///
|
///
|
||||||
|
|
||||||
use util::*;
|
use util::*;
|
||||||
@ -114,7 +114,7 @@ pub enum SyncState {
|
|||||||
Waiting,
|
Waiting,
|
||||||
/// Downloading blocks
|
/// Downloading blocks
|
||||||
Blocks,
|
Blocks,
|
||||||
/// Downloading blocks learned from NewHashes packet
|
/// Downloading blocks learned from `NewHashes` packet
|
||||||
NewBlocks,
|
NewBlocks,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +557,7 @@ impl ChainSync {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handles NewHashes packet. Initiates headers download for any unknown hashes.
|
/// Handles `NewHashes` packet. Initiates headers download for any unknown hashes.
|
||||||
fn on_peer_new_hashes(&mut self, io: &mut SyncIo, peer_id: PeerId, r: &UntrustedRlp) -> Result<(), PacketDecodeError> {
|
fn on_peer_new_hashes(&mut self, io: &mut SyncIo, peer_id: PeerId, r: &UntrustedRlp) -> Result<(), PacketDecodeError> {
|
||||||
if self.peers.get_mut(&peer_id).unwrap().asking != PeerAsking::Nothing {
|
if self.peers.get_mut(&peer_id).unwrap().asking != PeerAsking::Nothing {
|
||||||
trace!(target: "sync", "Ignoring new hashes since we're already downloading.");
|
trace!(target: "sync", "Ignoring new hashes since we're already downloading.");
|
||||||
|
@ -27,7 +27,7 @@ crossbeam = "0.2"
|
|||||||
slab = "0.1"
|
slab = "0.1"
|
||||||
sha3 = { path = "sha3" }
|
sha3 = { path = "sha3" }
|
||||||
serde = "0.7.0"
|
serde = "0.7.0"
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
json-tests = { path = "json-tests" }
|
json-tests = { path = "json-tests" }
|
||||||
igd = "0.4.2"
|
igd = "0.4.2"
|
||||||
ethcore-devtools = { path = "../devtools" }
|
ethcore-devtools = { path = "../devtools" }
|
||||||
|
@ -425,7 +425,7 @@ impl<'a, V1, V2, T3> ToBytesWithMap for (&'a Vec<V1>, &'a Vec<V2>, &'a T3)
|
|||||||
|
|
||||||
impl FromRawBytesVariable for Vec<u8> {
|
impl FromRawBytesVariable for Vec<u8> {
|
||||||
fn from_bytes_variable(bytes: &[u8]) -> Result<Vec<u8>, FromBytesError> {
|
fn from_bytes_variable(bytes: &[u8]) -> Result<Vec<u8>, FromBytesError> {
|
||||||
Ok(bytes.clone().to_vec())
|
Ok(bytes.to_vec())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ fn uuid_from_string(s: &str) -> Result<Uuid, UtilError> {
|
|||||||
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
/// Stored key file struct with encrypted message (`cipher_text`)
|
/// Stored key file struct with encrypted message `(cipher_text)`
|
||||||
/// also contains password derivation function settings (PBKDF2/Scrypt)
|
/// also contains password derivation function settings (PBKDF2/Scrypt)
|
||||||
pub struct KeyFileContent {
|
pub struct KeyFileContent {
|
||||||
version: KeyFileVersion,
|
version: KeyFileVersion,
|
||||||
|
@ -19,7 +19,7 @@ parity-webapp = { git = "https://github.com/tomusdrw/parity-webapp.git" }
|
|||||||
# List of apps
|
# List of apps
|
||||||
parity-status = { git = "https://github.com/tomusdrw/parity-status.git", version = "0.3.3" }
|
parity-status = { git = "https://github.com/tomusdrw/parity-status.git", version = "0.3.3" }
|
||||||
parity-wallet = { git = "https://github.com/tomusdrw/parity-wallet.git", optional = true }
|
parity-wallet = { git = "https://github.com/tomusdrw/parity-wallet.git", optional = true }
|
||||||
clippy = { version = "0.0.63", optional = true}
|
clippy = { version = "0.0.64", optional = true}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
Loading…
Reference in New Issue
Block a user