Skip to content

Commit

Permalink
chore(clippy): make clippy happy for rust 1.68
Browse files Browse the repository at this point in the history
  • Loading branch information
oetyng authored and RolandSherwin committed Mar 9, 2023
1 parent bad9bc6 commit 6d17af2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sn_interface/src/network_knowledge/sections_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Debug for SectionInfo {
.chain(self.sig.to_bytes().into_iter())
.collect();
let hex = hex::encode(bytes);
let hex: String = hex.chars().into_iter().take(10).collect();
let hex: String = hex.chars().take(10).collect();
write!(formatter, "SectionInfo({hex})")
}
}
Expand Down
2 changes: 1 addition & 1 deletion sn_interface/src/network_knowledge/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn section_decision<P: Proposition>(
proposal: P,
) -> Result<Decision<P>> {
let n = secret_key_set.threshold() + 1;
let mut nodes = Vec::from_iter((1..=n).into_iter().map(|idx| {
let mut nodes = Vec::from_iter((1..=n).map(|idx| {
let secret = (idx as u8, secret_key_set.secret_key_share(idx));
Consensus::from(secret, secret_key_set.public_keys(), n)
}));
Expand Down
2 changes: 1 addition & 1 deletion sn_interface/src/types/keys/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl PublicKey {
}
}

#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl Hash for PublicKey {
fn hash<H: Hasher>(&self, state: &mut H) {
utils::serialise(&self).unwrap_or_default().hash(state)
Expand Down
4 changes: 2 additions & 2 deletions sn_node/src/node/flow_ctrl/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ async fn spentbook_spend_with_updated_network_knowledge_should_update_the_node()
// At this point, only the genesis key should be in the proof chain on this node.
let tree = node.network_knowledge().section_tree().clone();
let proof_chain = tree.get_sections_dag().clone();
assert_eq!(proof_chain.keys().into_iter().count(), 1);
assert_eq!(proof_chain.keys().count(), 1);

// The key share also needs to be added to the section keys provider, which is stored
// on the node.
Expand Down Expand Up @@ -904,7 +904,7 @@ async fn spentbook_spend_with_updated_network_knowledge_should_update_the_node()
// Now the proof chain should have the other section key.
let tree = node.network_knowledge().section_tree().clone();
let proof_chain = tree.get_sections_dag().clone();
assert_eq!(proof_chain.keys().into_iter().count(), 2);
assert_eq!(proof_chain.keys().count(), 2);
let mut proof_chain_iter = proof_chain.keys();
let genesis_key = genesis_sk_set.public_keys().public_key();
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion sn_node/src/node/handover/handover_consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ mod tests {

// init dummy section
let elders_sk = SecretKeySet::random(7, &mut rng);
let mut nodes_handover_state = Vec::from_iter((1..=7).into_iter().map(|id| {
let mut nodes_handover_state = Vec::from_iter((1..=7).map(|id| {
Handover::from(
(id, elders_sk.secret_key_share(id as usize)),
elders_sk.public_keys(),
Expand Down

0 comments on commit 6d17af2

Please sign in to comment.