Fixing clippy warnings
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 } => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user