fix some clippy warnings

This commit is contained in:
Weiliang Li 2019-11-12 11:28:45 +09:00 committed by Andreas Fackler
parent d6ffccc06e
commit e43baa4b8b
7 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ rand_derive = "0.5.0"
reed-solomon-erasure = "3.1.1"
serde = { version = "1.0.102", features = ["derive", "rc"] }
threshold_crypto = { rev = "624eeee", git = "https://github.com/poanetwork/threshold_crypto" }
tiny-keccak = { version = "2.0.0", features = ["sha3"]}
tiny-keccak = { version = "2.0.1", features = ["sha3"]}
[dev-dependencies]
colored = "1.9.0"

View File

@ -40,7 +40,7 @@ pub fn make(
} else {
TcpStream::connect(address).expect("failed to connect")
};
Connection::new(tcp_conn, there_str.to_string())
Connection::new(tcp_conn, there_str)
})
.collect();
(here_str, connections)

View File

@ -272,7 +272,7 @@ where
for fault in &step.fault_log.0 {
if nodes.get(&fault.node_id).map_or(false, |n| !n.is_faulty()) {
return Err(CrankError::Fault {
reported_by: stepped_id.clone(),
reported_by: stepped_id,
faulty_id: fault.node_id.clone(),
fault_kind: fault.kind.clone(),
});

View File

@ -140,7 +140,7 @@ where
} = join_plan;
let new_pub_keys_opt = match change {
ChangeState::InProgress(Change::EncryptionSchedule(..)) | ChangeState::None => None,
ChangeState::InProgress(Change::NodeChange(pks)) => Some(pks.clone()),
ChangeState::InProgress(Change::NodeChange(pks)) => Some(pks),
ChangeState::Complete(change) => {
let valid = match change {
Change::EncryptionSchedule(schedule) => schedule == params.encryption_schedule,

View File

@ -41,7 +41,7 @@ where
VoteCounter {
our_id,
secret_key,
pub_keys: pub_keys.clone(),
pub_keys,
era,
pending: BTreeMap::new(),
committed: BTreeMap::new(),

View File

@ -140,7 +140,7 @@ impl<N: NodeIdT> ThresholdDecrypt<N> {
return Err(Error::MultipleInputs(Box::new(ct)));
}
if !ct.verify() {
return Err(Error::InvalidCiphertext(Box::new(ct.clone())));
return Err(Error::InvalidCiphertext(Box::new(ct)));
}
self.ciphertext = Some(ct);
Ok(())

View File

@ -157,7 +157,7 @@ fn do_drop_and_re_add(cfg: TestConfig) {
let mut awaiting_apply_new_subset: BTreeSet<_> = correct_nodes.clone();
let mut awaiting_apply_old_subset: BTreeSet<_> = correct_nodes.clone();
let mut awaiting_apply_old_subset_input: BTreeSet<_> = non_rm_nodes.clone();
let mut awaiting_apply_old_subset_in_progress: BTreeSet<_> = non_rm_nodes.clone();
let mut awaiting_apply_old_subset_in_progress: BTreeSet<_> = non_rm_nodes;
let mut expected_outputs: BTreeMap<_, BTreeSet<_>> = correct_nodes
.iter()
.map(|id| (id, (0..cfg.total_txs).collect()))