Fix lints introduced in Rust 1.35

This commit is contained in:
Paul Hauner 2019-05-28 10:46:01 +10:00
parent d72400cc9d
commit 6e5e1721f7
No known key found for this signature in database
GPG Key ID: 5E2CFF9B75FA63DF
4 changed files with 10 additions and 11 deletions

View File

@ -98,7 +98,7 @@ impl ClientConfig {
// Custom bootnodes
if let Some(boot_addresses_str) = args.value_of("boot-nodes") {
let mut boot_addresses_split = boot_addresses_str.split(",");
let boot_addresses_split = boot_addresses_str.split(",");
for boot_address in boot_addresses_split {
if let Ok(boot_address) = boot_address.parse::<Multiaddr>() {
config.net_conf.boot_nodes.append(&mut vec![boot_address]);

View File

@ -124,8 +124,9 @@ impl<T: Store, E: EthSpec> BitwiseLMDGhost<T, E> {
[log2_int((block_height - target_height - 1u64).as_u64()) as usize]
.get(&block_hash)
//TODO: Panic if we can't lookup and fork choice fails
.expect("All blocks should be added to the ancestor log lookup table");
self.get_ancestor(*ancestor_lookup, target_height, &spec)
.expect("All blocks should be added to the ancestor log lookup table")
.clone();
self.get_ancestor(ancestor_lookup, target_height, &spec)
} {
// add the result to the cache
self.cache.insert(cache_key, ancestor);
@ -151,7 +152,7 @@ impl<T: Store, E: EthSpec> BitwiseLMDGhost<T, E> {
// these have already been weighted by balance
for (hash, votes) in latest_votes.iter() {
if let Some(ancestor) = self.get_ancestor(*hash, block_height, spec) {
let current_vote_value = current_votes.get(&ancestor).unwrap_or_else(|| &0);
let current_vote_value = current_votes.get(&ancestor).unwrap_or_else(|| &0).clone();
current_votes.insert(ancestor, current_vote_value + *votes);
total_vote_count += votes;
}

View File

@ -124,8 +124,9 @@ impl<T: Store, E: EthSpec> OptimizedLMDGhost<T, E> {
[log2_int((block_height - target_height - 1u64).as_u64()) as usize]
.get(&block_hash)
//TODO: Panic if we can't lookup and fork choice fails
.expect("All blocks should be added to the ancestor log lookup table");
self.get_ancestor(*ancestor_lookup, target_height, &spec)
.expect("All blocks should be added to the ancestor log lookup table")
.clone();
self.get_ancestor(ancestor_lookup, target_height, &spec)
} {
// add the result to the cache
self.cache.insert(cache_key, ancestor);
@ -151,7 +152,7 @@ impl<T: Store, E: EthSpec> OptimizedLMDGhost<T, E> {
// these have already been weighted by balance
for (hash, votes) in latest_votes.iter() {
if let Some(ancestor) = self.get_ancestor(*hash, block_height, spec) {
let current_vote_value = current_votes.get(&ancestor).unwrap_or_else(|| &0);
let current_vote_value = current_votes.get(&ancestor).unwrap_or_else(|| &0).clone();
current_votes.insert(ancestor, current_vote_value + *votes);
total_vote_count += votes;
}

View File

@ -1,9 +1,6 @@
use slot_clock;
use error_chain::{
error_chain, error_chain_processing, impl_error_chain_kind, impl_error_chain_processed,
impl_extract_backtrace,
};
use error_chain::error_chain;
error_chain! {
links { }