Skip to content

Commit cc53273

Browse files
authored
Merge pull request #280 from input-output-hk/sg/mithril-snapshot-fetcher-clippy
chore: use clippy on mithril_snapshot_fetcher
2 parents 7262446 + 1290b90 commit cc53273

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.github/workflows/run-tests-on-push-to-main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
--package acropolis_module_chain_store \
3434
--package acropolis_module_consensus \
3535
--package acropolis_module_drdd_state \
36+
--package acropolis_module_mithril_snapshot_fetcher \
3637
--package acropolis_module_snapshot_bootstrapper \
3738
--package acropolis_module_spdd_state \
3839
--package acropolis_module_utxo_state

modules/mithril_snapshot_fetcher/src/mithril_snapshot_fetcher.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl MithrilSnapshotFetcher {
208208
// Download the snapshot
209209
fs::create_dir_all(&directory)?;
210210
let dir = Path::new(&directory);
211-
client.cardano_database().download_unpack(&snapshot, &dir).await?;
211+
client.cardano_database().download_unpack(&snapshot, dir).await?;
212212

213213
// Register download
214214
if let Err(e) = client.cardano_database().add_statistics(&snapshot).await {
@@ -281,9 +281,8 @@ impl MithrilSnapshotFetcher {
281281
}
282282

283283
// Skip EBBs
284-
match block {
285-
MultiEraBlock::EpochBoundary(_) => return Ok::<(), anyhow::Error>(()),
286-
_ => {}
284+
if let MultiEraBlock::EpochBoundary(_) = block {
285+
return Ok(());
287286
}
288287

289288
// Error and ignore any out of sequence
@@ -424,9 +423,8 @@ impl MithrilSnapshotFetcher {
424423
delay = (delay * 2).min(60);
425424
}
426425

427-
match Self::process_snapshot(context, config, genesis).await {
428-
Err(e) => error!("Failed to process Mithril snapshot: {e}"),
429-
_ => {}
426+
if let Err(e) = Self::process_snapshot(context, config, genesis).await {
427+
error!("Failed to process Mithril snapshot: {e}");
430428
}
431429
});
432430

modules/mithril_snapshot_fetcher/src/pause.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl PauseType {
5252
if block_info.new_epoch {
5353
return block_info.epoch == *target_epoch;
5454
}
55-
return false;
55+
false
5656
}
5757
PauseType::Block(target_block) => block_info.number == *target_block,
5858
PauseType::NoPause => false,

0 commit comments

Comments
 (0)