@@ -235,12 +235,11 @@ impl<D> CheckPoint<D> {
235235 }
236236
237237 // Now iterate normally from the found starting point
238- current. into_iter ( )
239- . take_while ( move |cp| match start_bound {
240- core:: ops:: Bound :: Included ( inc_bound) => cp. height ( ) >= inc_bound,
241- core:: ops:: Bound :: Excluded ( exc_bound) => cp. height ( ) > exc_bound,
242- core:: ops:: Bound :: Unbounded => true ,
243- } )
238+ current. into_iter ( ) . take_while ( move |cp| match start_bound {
239+ core:: ops:: Bound :: Included ( inc_bound) => cp. height ( ) >= inc_bound,
240+ core:: ops:: Bound :: Excluded ( exc_bound) => cp. height ( ) > exc_bound,
241+ core:: ops:: Bound :: Unbounded => true ,
242+ } )
244243 }
245244
246245 /// Returns the checkpoint at `height` if one exists, otherwise the nearest checkpoint at a
@@ -390,12 +389,16 @@ where
390389 let base_index = result. index ( ) ;
391390
392391 // First insert the new block
393- result = result. push_with_index ( height, data, base_index + 1 ) . expect ( "height is valid" ) ;
392+ result = result
393+ . push_with_index ( height, data, base_index + 1 )
394+ . expect ( "height is valid" ) ;
394395
395396 // Then re-add all the tail blocks with updated indices
396397 let mut current_index = base_index + 2 ;
397398 for ( h, d) in tail. into_iter ( ) . rev ( ) {
398- result = result. push_with_index ( h, d, current_index) . expect ( "tail is in order" ) ;
399+ result = result
400+ . push_with_index ( h, d, current_index)
401+ . expect ( "tail is in order" ) ;
399402 current_index += 1 ;
400403 }
401404
@@ -406,7 +409,9 @@ where
406409 fn push_with_index ( self , height : u32 , data : D , new_index : u32 ) -> Result < Self , Self > {
407410 if self . height ( ) < height {
408411 // Calculate skip pointer
409- let skip = if new_index >= CHECKPOINT_SKIP_INTERVAL && new_index % CHECKPOINT_SKIP_INTERVAL == 0 {
412+ let skip = if new_index >= CHECKPOINT_SKIP_INTERVAL
413+ && new_index % CHECKPOINT_SKIP_INTERVAL == 0
414+ {
410415 // Navigate back CHECKPOINT_SKIP_INTERVAL checkpoints
411416 let target_index = new_index - CHECKPOINT_SKIP_INTERVAL ;
412417 let mut current = Some ( self . 0 . clone ( ) ) ;
@@ -453,7 +458,9 @@ where
453458 let new_index = self . 0 . index + 1 ;
454459
455460 // Calculate skip pointer
456- let skip = if new_index >= CHECKPOINT_SKIP_INTERVAL && new_index % CHECKPOINT_SKIP_INTERVAL == 0 {
461+ let skip = if new_index >= CHECKPOINT_SKIP_INTERVAL
462+ && new_index % CHECKPOINT_SKIP_INTERVAL == 0
463+ {
457464 // Navigate back CHECKPOINT_SKIP_INTERVAL checkpoints
458465 let mut current = Some ( self . 0 . clone ( ) ) ;
459466 let mut steps = 0 ;
0 commit comments