@@ -210,7 +210,7 @@ impl<P: FlashblockPayload> FlashBlockCompleteSequence<P> {
210210 }
211211
212212 /// Returns the number of flashblocks in the sequence.
213- pub fn count ( & self ) -> usize {
213+ pub const fn count ( & self ) -> usize {
214214 self . inner . len ( )
215215 }
216216
@@ -235,10 +235,7 @@ impl<P: FlashblockPayload> FlashBlockCompleteSequence<P> {
235235 /// Returns all transactions from all flashblocks in the sequence
236236 pub fn all_transactions ( & self ) -> Vec < Bytes > {
237237 use crate :: traits:: FlashblockDiff ;
238- self . inner
239- . iter ( )
240- . flat_map ( |fb| fb. diff ( ) . transactions_raw ( ) . iter ( ) . cloned ( ) )
241- . collect ( )
238+ self . inner . iter ( ) . flat_map ( |fb| fb. diff ( ) . transactions_raw ( ) . iter ( ) . cloned ( ) ) . collect ( )
242239 }
243240
244241 /// Returns an iterator over all flashblocks in the sequence.
@@ -306,7 +303,8 @@ mod tests {
306303
307304 #[ test]
308305 fn test_insert_ignores_different_block_number ( ) {
309- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
306+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
307+ FlashBlockPendingSequence :: new ( ) ;
310308 let factory = TestFlashBlockFactory :: new ( ) ;
311309
312310 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -322,7 +320,8 @@ mod tests {
322320
323321 #[ test]
324322 fn test_insert_ignores_different_payload_id ( ) {
325- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
323+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
324+ FlashBlockPendingSequence :: new ( ) ;
326325 let factory = TestFlashBlockFactory :: new ( ) ;
327326
328327 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -340,7 +339,8 @@ mod tests {
340339
341340 #[ test]
342341 fn test_insert_maintains_btree_order ( ) {
343- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
342+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
343+ FlashBlockPendingSequence :: new ( ) ;
344344 let factory = TestFlashBlockFactory :: new ( ) ;
345345
346346 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -362,7 +362,8 @@ mod tests {
362362
363363 #[ test]
364364 fn test_finalize_empty_sequence_fails ( ) {
365- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
365+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
366+ FlashBlockPendingSequence :: new ( ) ;
366367 let result = sequence. finalize ( ) ;
367368
368369 assert ! ( result. is_err( ) ) ;
@@ -374,7 +375,8 @@ mod tests {
374375
375376 #[ test]
376377 fn test_finalize_clears_pending_state ( ) {
377- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
378+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
379+ FlashBlockPendingSequence :: new ( ) ;
378380 let factory = TestFlashBlockFactory :: new ( ) ;
379381
380382 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -391,7 +393,8 @@ mod tests {
391393
392394 #[ test]
393395 fn test_finalize_preserves_execution_outcome ( ) {
394- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
396+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
397+ FlashBlockPendingSequence :: new ( ) ;
395398 let factory = TestFlashBlockFactory :: new ( ) ;
396399
397400 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -408,7 +411,8 @@ mod tests {
408411
409412 #[ test]
410413 fn test_finalize_clears_cached_reads ( ) {
411- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
414+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
415+ FlashBlockPendingSequence :: new ( ) ;
412416 let factory = TestFlashBlockFactory :: new ( ) ;
413417
414418 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -426,7 +430,8 @@ mod tests {
426430
427431 #[ test]
428432 fn test_finalize_multiple_times_after_refill ( ) {
429- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
433+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
434+ FlashBlockPendingSequence :: new ( ) ;
430435 let factory = TestFlashBlockFactory :: new ( ) ;
431436
432437 // First sequence
@@ -616,7 +621,8 @@ mod tests {
616621
617622 #[ test]
618623 fn test_try_from_pending_to_complete_valid ( ) {
619- let mut pending: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
624+ let mut pending: FlashBlockPendingSequence < FlashBlock > =
625+ FlashBlockPendingSequence :: new ( ) ;
620626 let factory = TestFlashBlockFactory :: new ( ) ;
621627
622628 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -637,7 +643,8 @@ mod tests {
637643
638644 #[ test]
639645 fn test_try_from_preserves_execution_outcome ( ) {
640- let mut pending: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
646+ let mut pending: FlashBlockPendingSequence < FlashBlock > =
647+ FlashBlockPendingSequence :: new ( ) ;
641648 let factory = TestFlashBlockFactory :: new ( ) ;
642649
643650 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
@@ -657,7 +664,8 @@ mod tests {
657664
658665 #[ test]
659666 fn test_last_flashblock_returns_highest_index ( ) {
660- let mut sequence: FlashBlockPendingSequence < FlashBlock > = FlashBlockPendingSequence :: new ( ) ;
667+ let mut sequence: FlashBlockPendingSequence < FlashBlock > =
668+ FlashBlockPendingSequence :: new ( ) ;
661669 let factory = TestFlashBlockFactory :: new ( ) ;
662670
663671 let fb0 = factory. flashblock_at ( 0 ) . build ( ) ;
0 commit comments