66//#![allow(clippy::unwrap_used)]
77
88use cardano_blockchain_types:: {
9- hashes :: TransactionId , pallas_crypto , pallas_traverse , Cip36 , Fork , MetadatumLabel ,
10- MultiEraBlock , Network , Point , Slot , TxnIndex ,
9+ Cip36 , Fork , MetadatumLabel , MultiEraBlock , Network , Point , Slot , TxnIndex ,
10+ hashes :: TransactionId , pallas_crypto , pallas_traverse ,
1111} ;
1212#[ cfg( feature = "mimalloc" ) ]
1313use mimalloc:: MiMalloc ;
@@ -22,7 +22,7 @@ static GLOBAL: MiMalloc = MiMalloc;
2222use std:: { env, error:: Error , time:: Duration } ;
2323
2424use cardano_chain_follower:: { ChainFollower , ChainSyncConfig , ChainUpdate , Kind , Statistics } ;
25- use clap:: { arg , ArgAction , ArgMatches , Command } ;
25+ use clap:: { ArgAction , ArgMatches , Command , arg } ;
2626use tokio:: time:: Instant ;
2727use tracing:: { error, info, level_filters:: LevelFilter , warn} ;
2828use tracing_subscriber:: EnvFilter ;
@@ -338,15 +338,14 @@ async fn follow_for(
338338 || ( chain_update. immutable ( ) != last_immutable)
339339 || ( last_fork != chain_update. data . fork ( ) ) )
340340 && !last_update_shown
341+ && let Some ( last_update) = last_update. clone ( )
341342 {
342- if let Some ( last_update) = last_update. clone ( ) {
343- info ! (
344- chain = network. to_string( ) ,
345- "Chain Update {}:{}" ,
346- updates. saturating_sub( 1 ) ,
347- last_update
348- ) ;
349- }
343+ info ! (
344+ chain = network. to_string( ) ,
345+ "Chain Update {}:{}" ,
346+ updates. saturating_sub( 1 ) ,
347+ last_update
348+ ) ;
350349 }
351350
352351 // If these become true, we will show all blocks from the follower.
@@ -472,10 +471,8 @@ async fn follow_for(
472471 }
473472 }
474473
475- if !last_update_shown {
476- if let Some ( last_update) = last_update. clone ( ) {
477- info ! ( chain = network. to_string( ) , "Last Update: {}" , last_update) ;
478- }
474+ if !last_update_shown && let Some ( last_update) = last_update. clone ( ) {
475+ info ! ( chain = network. to_string( ) , "Last Update: {}" , last_update) ;
479476 }
480477
481478 if !inhibit_stats {
@@ -554,7 +551,7 @@ fn update_largest_aux(
554551 largest_metadata_size : & mut usize ,
555552) {
556553 match block {
557- pallas_traverse:: MultiEraBlock :: AlonzoCompatible ( ref b, _) => {
554+ pallas_traverse:: MultiEraBlock :: AlonzoCompatible ( b, _) => {
558555 b. auxiliary_data_set . iter ( ) . for_each ( |( txn_idx, aux_data) | {
559556 compare_and_log_aux (
560557 aux_data. raw_cbor ( ) . len ( ) ,
@@ -565,7 +562,7 @@ fn update_largest_aux(
565562 ) ;
566563 } ) ;
567564 } ,
568- pallas_traverse:: MultiEraBlock :: Babbage ( ref b) => {
565+ pallas_traverse:: MultiEraBlock :: Babbage ( b) => {
569566 b. auxiliary_data_set . iter ( ) . for_each ( |( txn_idx, aux_data) | {
570567 compare_and_log_aux (
571568 aux_data. raw_cbor ( ) . len ( ) ,
@@ -576,7 +573,7 @@ fn update_largest_aux(
576573 ) ;
577574 } ) ;
578575 } ,
579- pallas_traverse:: MultiEraBlock :: Conway ( ref b) => {
576+ pallas_traverse:: MultiEraBlock :: Conway ( b) => {
580577 b. auxiliary_data_set . iter ( ) . for_each ( |( txn_idx, aux_data) | {
581578 compare_and_log_aux (
582579 aux_data. raw_cbor ( ) . len ( ) ,
0 commit comments