Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Updating clippy #766

Merged
merged 3 commits into from
Mar 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fdlimit = { path = "util/fdlimit" }
daemonize = "0.2"
number_prefix = "0.2"
rpassword = "0.1"
clippy = { version = "0.0.50", optional = true }
clippy = { version = "0.0.54", optional = true }
ethcore = { path = "ethcore" }
ethcore-util = { path = "util" }
ethsync = { path = "sync" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ethcore-util = { path = "../util" }
evmjit = { path = "../evmjit", optional = true }
ethash = { path = "../ethash" }
num_cpus = "0.2"
clippy = { version = "0.0.50", optional = true }
clippy = { version = "0.0.54", optional = true }
crossbeam = "0.1.5"
lazy_static = "0.1"
ethcore-devtools = { path = "../devtools" }
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/evm/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub trait Ext {
/// Returns Err, if we run out of gas.
/// Otherwise returns call_result which contains gas left
/// and true if subcall was successfull.
#[cfg_attr(feature="dev", allow(too_many_arguments))]
fn call(&mut self,
gas: &U256,
sender_address: &Address,
Expand Down
1 change: 1 addition & 0 deletions ethcore/src/evm/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ impl Interpreter {
Ok(overflowing!(offset.overflowing_add(size.clone())))
}

#[cfg_attr(feature="dev", allow(too_many_arguments))]
fn exec_instruction(&self,
gas: Gas,
params: &ActionParams,
Expand Down
2 changes: 1 addition & 1 deletion json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.50", optional = true }
clippy = { version = "0.0.54", optional = true }

[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
rayon = "0.3.1"
clippy = { version = "0.0.50", optional = true }
clippy = { version = "0.0.54", optional = true }

[features]
default = []
Expand Down
4 changes: 0 additions & 4 deletions miner/src/transaction_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ impl TransactionQueue {
self.minimal_gas_price = min_gas_price;
}

// Will be used when rpc merged
#[allow(dead_code)]
/// Returns current status for this queue
pub fn status(&self) -> TransactionQueueStatus {
TransactionQueueStatus {
Expand Down Expand Up @@ -456,8 +454,6 @@ impl TransactionQueue {
self.future.enforce_limit(&mut self.by_hash);
}

// Will be used when mining merged
#[allow(dead_code)]
/// Returns top transactions from the queue ordered by priority.
pub fn top_transactions(&self) -> Vec<SignedTransaction> {
self.current.by_priority
Expand Down
3 changes: 2 additions & 1 deletion parity/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl Configuration {

fn init_nodes(&self, spec: &Spec) -> Vec<String> {
match self.args.flag_bootnodes {
Some(ref x) if x.len() > 0 => x.split(',').map(|s| {
Some(ref x) if !x.is_empty() => x.split(',').map(|s| {
Self::normalize_enode(s).unwrap_or_else(|| {
die!("{}: Invalid node address format given for a boot node.", s)
})
Expand Down Expand Up @@ -409,6 +409,7 @@ impl Configuration {
ret
}

#[cfg_attr(feature="dev", allow(useless_format))]
fn client_config(&self) -> ClientConfig {
let mut client_config = ClientConfig::default();
match self.args.flag_cache {
Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.50", optional = true }
clippy = { version = "0.0.54", optional = true }

[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = ["Ethcore <[email protected]"]
[dependencies]
ethcore-util = { path = "../util" }
ethcore = { path = "../ethcore" }
clippy = { version = "0.0.50", optional = true }
clippy = { version = "0.0.54", optional = true }
ethminer = { path = "../miner" }
log = "0.3"
env_logger = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ crossbeam = "0.2"
slab = "0.1"
sha3 = { path = "sha3" }
serde = "0.7.0"
clippy = { version = "0.0.50", optional = true }
clippy = { version = "0.0.54", optional = true }
json-tests = { path = "json-tests" }
igd = "0.4.2"
ethcore-devtools = { path = "../devtools" }
Expand Down
4 changes: 3 additions & 1 deletion util/src/journaldb/archivedb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ impl JournalDB for ArchiveDB {

#[cfg(test)]
mod tests {
#![cfg_attr(feature="dev", allow(blacklisted_name))]

use common::*;
use super::*;
use hashdb::*;
Expand Down Expand Up @@ -371,7 +373,7 @@ mod tests {
jdb.commit(5, &b"5".sha3(), Some((4, b"4".sha3()))).unwrap();
}
}

#[test]
fn reopen_fork() {
let mut dir = ::std::env::temp_dir();
Expand Down
2 changes: 2 additions & 0 deletions util/src/journaldb/earlymergedb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ impl JournalDB for EarlyMergeDB {

#[cfg(test)]
mod tests {
#![cfg_attr(feature="dev", allow(blacklisted_name))]

use common::*;
use super::*;
use super::super::traits::JournalDB;
Expand Down
2 changes: 2 additions & 0 deletions util/src/journaldb/overlayrecentdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ impl HashDB for OverlayRecentDB {

#[cfg(test)]
mod tests {
#![cfg_attr(feature="dev", allow(blacklisted_name))]

use common::*;
use super::*;
use hashdb::*;
Expand Down
10 changes: 6 additions & 4 deletions util/src/journaldb/refcounteddb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use std::env;
/// Implementation of the HashDB trait for a disk-backed database with a memory overlay
/// and latent-removal semantics.
///
/// Like OverlayDB, there is a memory overlay; `commit()` must be called in order to
/// Like OverlayDB, there is a memory overlay; `commit()` must be called in order to
/// write operations out to disk. Unlike OverlayDB, `remove()` operations do not take effect
/// immediately. Rather some age (based on a linear but arbitrary metric) must pass before
/// the removals actually take effect.
Expand Down Expand Up @@ -113,15 +113,15 @@ impl JournalDB for RefCountedDB {
}

fn commit(&mut self, now: u64, id: &H256, end: Option<(u64, H256)>) -> Result<u32, UtilError> {
// journal format:
// journal format:
// [era, 0] => [ id, [insert_0, ...], [remove_0, ...] ]
// [era, 1] => [ id, [insert_0, ...], [remove_0, ...] ]
// [era, n] => [ ... ]

// TODO: store last_era, reclaim_period.

// when we make a new commit, we journal the inserts and removes.
// for each end_era that we journaled that we are no passing by,
// for each end_era that we journaled that we are no passing by,
// we remove all of its removes assuming it is canonical and all
// of its inserts otherwise.

Expand All @@ -147,7 +147,7 @@ impl JournalDB for RefCountedDB {
r.append(&self.inserts);
r.append(&self.removes);
try!(batch.put(&last, r.as_raw()));

trace!(target: "rcdb", "new journal for time #{}.{} => {}: inserts={:?}, removes={:?}", now, index, id, self.inserts, self.removes);

self.inserts.clear();
Expand Down Expand Up @@ -194,6 +194,8 @@ impl JournalDB for RefCountedDB {

#[cfg(test)]
mod tests {
#![cfg_attr(feature="dev", allow(blacklisted_name))]

use common::*;
use super::*;
use super::super::traits::JournalDB;
Expand Down
2 changes: 1 addition & 1 deletion util/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn version_data() -> Bytes {
u32::from_str(env!("CARGO_PKG_VERSION_PATCH")).unwrap();
s.append(&v);
s.append(&"Parity");
s.append(&format!("{}", rustc_version()));
s.append(&rustc_version());
s.append(&&Target::os()[0..2]);
s.out()
}
6 changes: 4 additions & 2 deletions util/src/network/ip_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl SocketAddrExt for Ipv4Addr {

fn is_global_s(&self) -> bool {
!self.is_private() && !self.is_loopback() && !self.is_link_local() &&
!self.is_broadcast() && !self.is_documentation()
!self.is_broadcast() && !self.is_documentation()
}
}

Expand Down Expand Up @@ -216,6 +216,8 @@ fn can_map_external_address_or_fail() {

#[test]
fn ipv4_properties() {

#![cfg_attr(feature="dev", allow(too_many_arguments))]
fn check(octets: &[u8; 4], unspec: bool, loopback: bool,
private: bool, link_local: bool, global: bool,
multicast: bool, broadcast: bool, documentation: bool) {
Expand Down Expand Up @@ -262,7 +264,7 @@ fn ipv6_properties() {
assert_eq!(ip.is_global_s(), global);
}

// unspec loopbk global
// unspec loopbk global
check("::", true, false, true);
check("::1", false, true, false);
}