Fix compiler warnings

This commit is contained in:
Greg Fitzgerald 2018-06-26 15:43:20 -06:00 committed by Grimes
parent 136b43f461
commit 05edfad13a
3 changed files with 8 additions and 10 deletions

View File

@ -1,5 +1,5 @@
use crdt::ReplicatedData;
use rand::distributions::{IndependentSample, Weighted, WeightedChoice};
use rand::distributions::{Distribution, Weighted, WeightedChoice};
use rand::thread_rng;
use result::{Error, Result};
use signature::PublicKey;
@ -184,7 +184,7 @@ impl<'a> ChooseGossipPeerStrategy for ChooseWeightedPeerStrategy<'a> {
}
let mut rng = thread_rng();
Ok(WeightedChoice::new(&mut weighted_peers).ind_sample(&mut rng))
Ok(WeightedChoice::new(&mut weighted_peers).sample(&mut rng))
}
}
@ -196,8 +196,8 @@ mod tests {
use std;
use std::collections::HashMap;
fn get_stake(id: PublicKey) -> f64 {
return 1.0;
fn get_stake(_id: PublicKey) -> f64 {
1.0
}
#[test]
@ -315,7 +315,7 @@ mod tests {
remote.insert(key1, old_index);
for i in 0..num_peers {
for _i in 0..num_peers {
let pk = KeyPair::new().pubkey();
rumors.insert(pk, old_index);
}

View File

@ -15,9 +15,7 @@
use bincode::{deserialize, serialize};
use byteorder::{LittleEndian, ReadBytesExt};
use choose_gossip_peer_strategy::{
ChooseGossipPeerStrategy, ChooseRandomPeerStrategy, ChooseWeightedPeerStrategy,
};
use choose_gossip_peer_strategy::{ChooseGossipPeerStrategy, ChooseWeightedPeerStrategy};
use hash::Hash;
use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE};
use pnet_datalink as datalink;
@ -491,7 +489,7 @@ impl Crdt {
}
// TODO: fill in with real implmentation once staking is implemented
fn get_stake(id: PublicKey) -> f64 {
fn get_stake(_id: PublicKey) -> f64 {
1.0
}

View File

@ -13,7 +13,7 @@ pub mod bank;
pub mod banking_stage;
pub mod blob_fetch_stage;
pub mod budget;
mod choose_gossip_peer_strategy;
pub mod choose_gossip_peer_strategy;
pub mod crdt;
pub mod drone;
pub mod entry;