Skip to content

Commit 57edd30

Browse files
committed
clippy
1 parent a1548c8 commit 57edd30

File tree

1 file changed

+3
-2
lines changed
  • crates/starfish/core/src/network

1 file changed

+3
-2
lines changed

crates/starfish/core/src/network/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ fn authority_set_to_bitmask(authorities: &BTreeSet<AuthorityIndex>) -> [u64; 4]
272272

273273
fn bitmask_to_authority_set(bitmask: [u64; 4]) -> BTreeSet<AuthorityIndex> {
274274
let mut set = BTreeSet::new();
275-
for array_index in 0..4 {
276-
let mut bits = bitmask[array_index];
275+
for (array_index, &bits) in bitmask.iter().enumerate() {
276+
let mut bits = bits;
277277
let base = array_index * 64;
278278
while bits != 0 {
279279
let bit = bits.trailing_zeros() as usize;
@@ -283,6 +283,7 @@ fn bitmask_to_authority_set(bitmask: [u64; 4]) -> BTreeSet<AuthorityIndex> {
283283
}
284284
set
285285
}
286+
286287
impl SerializedBlockBundleParts {
287288
pub(crate) fn useful_authorities(&self) -> BTreeSet<AuthorityIndex> {
288289
bitmask_to_authority_set(self.useful_authorities_bitmask)

0 commit comments

Comments
 (0)