Fix compiler warnings
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
use crdt::ReplicatedData;
|
use crdt::ReplicatedData;
|
||||||
use rand::distributions::{IndependentSample, Weighted, WeightedChoice};
|
use rand::distributions::{Distribution, Weighted, WeightedChoice};
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use signature::PublicKey;
|
use signature::PublicKey;
|
||||||
@ -184,7 +184,7 @@ impl<'a> ChooseGossipPeerStrategy for ChooseWeightedPeerStrategy<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut rng = thread_rng();
|
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;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
fn get_stake(id: PublicKey) -> f64 {
|
fn get_stake(_id: PublicKey) -> f64 {
|
||||||
return 1.0;
|
1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -315,7 +315,7 @@ mod tests {
|
|||||||
|
|
||||||
remote.insert(key1, old_index);
|
remote.insert(key1, old_index);
|
||||||
|
|
||||||
for i in 0..num_peers {
|
for _i in 0..num_peers {
|
||||||
let pk = KeyPair::new().pubkey();
|
let pk = KeyPair::new().pubkey();
|
||||||
rumors.insert(pk, old_index);
|
rumors.insert(pk, old_index);
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
|
|
||||||
use bincode::{deserialize, serialize};
|
use bincode::{deserialize, serialize};
|
||||||
use byteorder::{LittleEndian, ReadBytesExt};
|
use byteorder::{LittleEndian, ReadBytesExt};
|
||||||
use choose_gossip_peer_strategy::{
|
use choose_gossip_peer_strategy::{ChooseGossipPeerStrategy, ChooseWeightedPeerStrategy};
|
||||||
ChooseGossipPeerStrategy, ChooseRandomPeerStrategy, ChooseWeightedPeerStrategy,
|
|
||||||
};
|
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE};
|
use packet::{to_blob, Blob, BlobRecycler, SharedBlob, BLOB_SIZE};
|
||||||
use pnet_datalink as datalink;
|
use pnet_datalink as datalink;
|
||||||
@ -491,7 +489,7 @@ impl Crdt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fill in with real implmentation once staking is implemented
|
// TODO: fill in with real implmentation once staking is implemented
|
||||||
fn get_stake(id: PublicKey) -> f64 {
|
fn get_stake(_id: PublicKey) -> f64 {
|
||||||
1.0
|
1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ pub mod bank;
|
|||||||
pub mod banking_stage;
|
pub mod banking_stage;
|
||||||
pub mod blob_fetch_stage;
|
pub mod blob_fetch_stage;
|
||||||
pub mod budget;
|
pub mod budget;
|
||||||
mod choose_gossip_peer_strategy;
|
pub mod choose_gossip_peer_strategy;
|
||||||
pub mod crdt;
|
pub mod crdt;
|
||||||
pub mod drone;
|
pub mod drone;
|
||||||
pub mod entry;
|
pub mod entry;
|
||||||
|
Reference in New Issue
Block a user