Bumping clippy & fixing warnings (#1024)

* Bumping clippy

* Fixing warnings found by clippy
This commit is contained in:
Tomasz Drwięga 2016-05-02 13:13:12 +02:00 committed by Gav Wood
parent 7c2adc4137
commit e2465b1eab
17 changed files with 27 additions and 26 deletions

16
Cargo.lock generated
View File

@ -3,7 +3,7 @@ name = "parity"
version = "1.1.0"
dependencies = [
"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)",
"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)",
@ -136,7 +136,7 @@ dependencies = [
[[package]]
name = "clippy"
version = "0.0.63"
version = "0.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"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"
dependencies = [
"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)",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.1.0",
@ -310,7 +310,7 @@ dependencies = [
name = "ethcore-rpc"
version = "1.1.0"
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",
"ethcore 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)",
"bigint 0.1.0",
"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)",
"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)",
@ -366,7 +366,7 @@ dependencies = [
name = "ethcore-webapp"
version = "1.1.0"
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-util 1.1.0",
"hyper 0.9.0-mio (git+https://github.com/hyperium/hyper?branch=mio)",
@ -394,7 +394,7 @@ dependencies = [
name = "ethminer"
version = "1.1.0"
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)",
"ethcore 1.1.0",
"ethcore-util 1.1.0",
@ -408,7 +408,7 @@ dependencies = [
name = "ethsync"
version = "1.1.0"
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)",
"ethcore 1.1.0",
"ethcore-util 1.1.0",

View File

@ -23,7 +23,7 @@ daemonize = "0.2"
num_cpus = "0.2"
number_prefix = "0.2"
rpassword = "0.2.1"
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
ethcore = { path = "ethcore" }
ethcore-util = { path = "util" }
ethsync = { path = "sync" }

View File

@ -17,7 +17,7 @@ ethcore-util = { path = "../util" }
evmjit = { path = "../evmjit", optional = true }
ethash = { path = "../ethash" }
num_cpus = "0.2"
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
crossbeam = "0.1.5"
lazy_static = "0.1"
ethcore-devtools = { path = "../devtools" }

View File

@ -26,7 +26,7 @@ use crossbeam;
/// 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)
/// 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;
/// Returns new address created from address and given nonce.

View File

@ -87,7 +87,7 @@ impl Encodable for BlockTracesBloomGroup {
}
}
/// Represents BloomGroup position in database.
/// Represents `BloomGroup` position in database.
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
pub struct TraceGroupPosition {
/// Bloom level.

View File

@ -33,6 +33,7 @@ use super::flat::{FlatTrace, FlatBlockTraces, FlatTransactionTraces};
const TRACE_DB_VER: &'static [u8] = b"1.0";
#[derive(Debug, Copy, Clone)]
#[cfg_attr(feature="dev", allow(enum_variant_names))]
enum TraceDBIndex {
/// Block traces index.
BlockTraces = 0,

View File

@ -88,7 +88,7 @@ pub trait Tracer: Send {
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.
pub trait DatabaseExtras {
/// Returns hash of given block number.

View File

@ -10,7 +10,7 @@ rustc-serialize = "0.3"
serde = "0.7.0"
serde_json = "0.7.0"
serde_macros = { version = "0.7.0", optional = true }
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }

View File

@ -17,7 +17,7 @@ log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
rayon = "0.3.1"
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
[features]
default = []

View File

@ -205,9 +205,9 @@ impl MinerService for Miner {
let last_hashes = chain.last_hashes();
let env_info = EnvInfo {
number: header.number(),
author: header.author().clone(),
author: *header.author(),
timestamp: header.timestamp(),
difficulty: header.difficulty().clone(),
difficulty: *header.difficulty(),
last_hashes: last_hashes,
gas_used: U256::zero(),
gas_limit: U256::max_value(),

View File

@ -22,7 +22,7 @@ ethminer = { path = "../miner" }
rustc-serialize = "0.3"
transient-hashmap = "0.1"
serde_macros = { version = "0.7.0", optional = true }
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }

View File

@ -10,7 +10,7 @@ authors = ["Ethcore <admin@ethcore.io"]
[dependencies]
ethcore-util = { path = "../util" }
ethcore = { path = "../ethcore" }
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
ethminer = { path = "../miner" }
log = "0.3"
env_logger = "0.3"

View File

@ -26,7 +26,7 @@
/// 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.
/// 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::*;
@ -114,7 +114,7 @@ pub enum SyncState {
Waiting,
/// Downloading blocks
Blocks,
/// Downloading blocks learned from NewHashes packet
/// Downloading blocks learned from `NewHashes` packet
NewBlocks,
}
@ -557,7 +557,7 @@ impl ChainSync {
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> {
if self.peers.get_mut(&peer_id).unwrap().asking != PeerAsking::Nothing {
trace!(target: "sync", "Ignoring new hashes since we're already downloading.");

View File

@ -27,7 +27,7 @@ crossbeam = "0.2"
slab = "0.1"
sha3 = { path = "sha3" }
serde = "0.7.0"
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
json-tests = { path = "json-tests" }
igd = "0.4.2"
ethcore-devtools = { path = "../devtools" }

View File

@ -425,7 +425,7 @@ impl<'a, V1, V2, T3> ToBytesWithMap for (&'a Vec<V1>, &'a Vec<V2>, &'a T3)
impl FromRawBytesVariable for Vec<u8> {
fn from_bytes_variable(bytes: &[u8]) -> Result<Vec<u8>, FromBytesError> {
Ok(bytes.clone().to_vec())
Ok(bytes.to_vec())
}
}

View File

@ -326,7 +326,7 @@ fn uuid_from_string(s: &str) -> Result<Uuid, UtilError> {
#[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)
pub struct KeyFileContent {
version: KeyFileVersion,

View File

@ -19,7 +19,7 @@ parity-webapp = { git = "https://github.com/tomusdrw/parity-webapp.git" }
# List of apps
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 }
clippy = { version = "0.0.63", optional = true}
clippy = { version = "0.0.64", optional = true}
[features]
default = []