From 1290b9027f9d84270e6f72b915ce4afd22cf1a04 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Thu, 23 Oct 2025 14:43:17 -0400 Subject: [PATCH] chore: use clippy on mithril_snapshot_fetcher --- .github/workflows/run-tests-on-push-to-main.yml | 1 + .../src/mithril_snapshot_fetcher.rs | 12 +++++------- modules/mithril_snapshot_fetcher/src/pause.rs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests-on-push-to-main.yml b/.github/workflows/run-tests-on-push-to-main.yml index 2883852b..5e93aa62 100644 --- a/.github/workflows/run-tests-on-push-to-main.yml +++ b/.github/workflows/run-tests-on-push-to-main.yml @@ -32,6 +32,7 @@ jobs: --package acropolis_module_block_unpacker \ --package acropolis_module_consensus \ --package acropolis_module_drdd_state \ + --package acropolis_module_mithril_snapshot_fetcher \ --package acropolis_module_snapshot_bootstrapper \ --package acropolis_module_spdd_state \ --package acropolis_module_utxo_state diff --git a/modules/mithril_snapshot_fetcher/src/mithril_snapshot_fetcher.rs b/modules/mithril_snapshot_fetcher/src/mithril_snapshot_fetcher.rs index 97061df4..84c10703 100644 --- a/modules/mithril_snapshot_fetcher/src/mithril_snapshot_fetcher.rs +++ b/modules/mithril_snapshot_fetcher/src/mithril_snapshot_fetcher.rs @@ -208,7 +208,7 @@ impl MithrilSnapshotFetcher { // Download the snapshot fs::create_dir_all(&directory)?; let dir = Path::new(&directory); - client.cardano_database().download_unpack(&snapshot, &dir).await?; + client.cardano_database().download_unpack(&snapshot, dir).await?; // Register download if let Err(e) = client.cardano_database().add_statistics(&snapshot).await { @@ -281,9 +281,8 @@ impl MithrilSnapshotFetcher { } // Skip EBBs - match block { - MultiEraBlock::EpochBoundary(_) => return Ok::<(), anyhow::Error>(()), - _ => {} + if let MultiEraBlock::EpochBoundary(_) = block { + return Ok(()); } // Error and ignore any out of sequence @@ -424,9 +423,8 @@ impl MithrilSnapshotFetcher { delay = (delay * 2).min(60); } - match Self::process_snapshot(context, config, genesis).await { - Err(e) => error!("Failed to process Mithril snapshot: {e}"), - _ => {} + if let Err(e) = Self::process_snapshot(context, config, genesis).await { + error!("Failed to process Mithril snapshot: {e}"); } }); diff --git a/modules/mithril_snapshot_fetcher/src/pause.rs b/modules/mithril_snapshot_fetcher/src/pause.rs index 1b5eaba3..0e57bed1 100644 --- a/modules/mithril_snapshot_fetcher/src/pause.rs +++ b/modules/mithril_snapshot_fetcher/src/pause.rs @@ -52,7 +52,7 @@ impl PauseType { if block_info.new_epoch { return block_info.epoch == *target_epoch; } - return false; + false } PauseType::Block(target_block) => block_info.number == *target_block, PauseType::NoPause => false,