Skip to content

Commit 329455f

Browse files
committed
fix(cardano-chain-follower): linter and format
Signed-off-by: bkioshn <[email protected]>
1 parent 476e131 commit 329455f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

rust/cardano-chain-follower/src/chain_sync_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ impl ChainSyncConfig {
125125
///
126126
/// `Error`: On error.
127127
pub async fn run(self) -> Result<()> {
128+
/// Thread name for stats.
128129
const THREAD_NAME: &str = "ChainSync";
129130
debug!(
130131
chain = self.chain.to_string(),

rust/cardano-chain-follower/src/mithril_snapshot_config.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! Configuration for the Mithril Snapshot used by the follower.
22
33
use std::{
4-
panic, path::{Path, PathBuf}, str::FromStr, sync::LazyLock
4+
panic,
5+
path::{Path, PathBuf},
6+
str::FromStr,
7+
sync::LazyLock,
58
};
69

710
use anyhow::bail;
@@ -18,7 +21,12 @@ use tokio::{
1821
use tracing::{debug, error};
1922

2023
use crate::{
21-
error::{Error, Result}, mithril_snapshot_data::{latest_mithril_snapshot_id, SnapshotData}, mithril_snapshot_sync::background_mithril_update, snapshot_id::SnapshotId, stats, turbo_downloader::DlConfig
24+
error::{Error, Result},
25+
mithril_snapshot_data::{latest_mithril_snapshot_id, SnapshotData},
26+
mithril_snapshot_sync::background_mithril_update,
27+
snapshot_id::SnapshotId,
28+
stats,
29+
turbo_downloader::DlConfig,
2230
};
2331

2432
/// Type we use to manage the Sync Task handle map.

rust/cardano-chain-follower/src/stats/thread.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ struct InnerThreadStat {
3636

3737
impl Serialize for InnerThreadStat {
3838
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
39-
where
40-
S: Serializer,
41-
{
39+
where S: Serializer {
4240
let mut state = serializer.serialize_struct("ThreadStat", 6)?;
4341

4442
state.serialize_field("counter", &self.counter.load(Ordering::SeqCst))?;
@@ -82,7 +80,7 @@ impl Default for InnerThreadStat {
8280
}
8381

8482
impl InnerThreadStat {
85-
/// Update the CPU time including the total CPU time and the latest CPU time.
83+
/// Update the total time of the CPU used.
8684
fn update_total_time(&self) {
8785
// Get the current CPU time as a Duration
8886
let current_time = ThreadTime::now().as_duration();
@@ -103,6 +101,7 @@ impl InnerThreadStat {
103101
}
104102
}
105103

104+
/// Update the latest time of the CPU used.
106105
fn update_latest_time(&self) {
107106
if let Ok(mut latest_cpu_time) = self.latest_cpu_time.lock() {
108107
*latest_cpu_time = ThreadTime::now().as_duration();

rust/cardano-chain-follower/src/turbo_downloader/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ impl ParallelDownloadProcessor {
478478
let mut block;
479479
// debug!("Worker {worker_id} DL chunk {next_chunk}");
480480
loop {
481-
482481
block = match params.get_range(&http_agent, next_chunk) {
483482
Ok(block) => Some(block),
484483
Err(error) => {

0 commit comments

Comments
 (0)