Fixing clippy warnings

This commit is contained in:
Tomasz Drwięga
2016-03-11 10:57:58 +01:00
parent 3a4a7ac822
commit 8709dd28f8
17 changed files with 131 additions and 39 deletions

View File

@@ -1307,7 +1307,7 @@ impl ChainSync {
where T: Fn(&Address) -> U256
{
let mut queue = self.transaction_queue.lock().unwrap();
queue.add(transaction, fetch_nonce);
let _ = queue.add(transaction, fetch_nonce);
}
}

View File

@@ -17,9 +17,10 @@
#![warn(missing_docs)]
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
#![cfg_attr(all(nightly, feature="dev"), allow(clone_on_copy))]
// In most cases it expresses function flow better
#![cfg_attr(all(nightly, feature="dev"), allow(if_not_else))]
//! Blockchain sync module
//! Implements ethereum protocol version 63 as specified here:
@@ -172,6 +173,7 @@ impl NetworkProtocolHandler<SyncMessage> for EthSync {
self.sync.write().unwrap().maintain_sync(&mut NetSyncIo::new(io, self.chain.deref()));
}
#[allow(single_match)]
fn message(&self, io: &NetworkContext<SyncMessage>, message: &SyncMessage) {
match *message {
SyncMessage::NewChainBlocks { ref good, ref bad, ref retracted } => {

View File

@@ -79,6 +79,7 @@
//! - When it's removed from `current` - all transactions from this sender (`current` & `future`) are recalculated.
//!
use std::default::Default;
use std::cmp::{Ordering};
use std::collections::{HashMap, BTreeSet};
use util::numbers::{Uint, U256};
@@ -102,6 +103,7 @@ struct TransactionOrder {
hash: H256,
}
impl TransactionOrder {
fn for_transaction(tx: &VerifiedTransaction, base_nonce: U256) -> Self {
TransactionOrder {
@@ -253,6 +255,12 @@ pub struct TransactionQueue {
last_nonces: HashMap<Address, U256>,
}
impl Default for TransactionQueue {
fn default() -> Self {
TransactionQueue::new()
}
}
impl TransactionQueue {
/// Creates new instance of this Queue
pub fn new() -> Self {