Skip to content

Commit 2b7dbb3

Browse files
committed
tests: Fix warnings from clippy::never_loop
1 parent e910eae commit 2b7dbb3

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • graph/src/components/subgraph/proof_of_indexing

graph/src/components/subgraph/proof_of_indexing/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@ mod tests {
148148
// Create a database which stores intermediate PoIs
149149
let mut db = HashMap::<Id, Vec<u8>>::new();
150150

151-
let mut block_count = 1;
152-
for causality_region in case.data.causality_regions.values() {
153-
block_count = causality_region.blocks.len();
154-
break;
155-
}
151+
let block_count = match case.data.causality_regions.values().next() {
152+
Some(causality_region) => causality_region.blocks.len(),
153+
None => 1,
154+
};
156155

157156
for block_i in 0..block_count {
158157
let mut stream = ProofOfIndexing::new(block_i.try_into().unwrap(), version);

0 commit comments

Comments
 (0)