Skip to content

Commit 81d08dc

Browse files
authored
Merge pull request #2631 from input-output-hk/dlachaume/2582/fix-cargo-fmt-ignore-files
fix: formatting issues with `cargo fmt`
2 parents a6d5487 + 630eb02 commit 81d08dc

34 files changed

+876
-673
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/client-cardano-database-v2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database-v2"
33
description = "Mithril client Cardano database example"
4-
version = "0.0.10"
4+
version = "0.0.11"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database-v2/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! A [FeedbackReceiver] using [indicatif] is used to nicely report the progress to the console.
66
7-
use anyhow::{anyhow, Context};
7+
use anyhow::{Context, anyhow};
88
use async_trait::async_trait;
99
use clap::Parser;
1010
use futures::Future;

examples/client-cardano-database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database"
33
description = "Mithril client Cardano database example"
4-
version = "0.1.34"
4+
version = "0.1.35"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! A [FeedbackReceiver] using [indicatif] is used to nicely report the progress to the console.
66
7-
use anyhow::{anyhow, Context};
7+
use anyhow::{Context, anyhow};
88
use async_trait::async_trait;
99
use clap::Parser;
1010
use futures::Future;

mithril-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-client"
3-
version = "0.12.19"
3+
version = "0.12.20"
44
description = "Mithril client library"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-client/src/cardano_database_client/download_unpack/download_task.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::path::{Path, PathBuf};
33
use std::pin::Pin;
44
use std::sync::Arc;
55

6-
use anyhow::{anyhow, Context};
6+
use anyhow::{Context, anyhow};
77
use slog::Logger;
88

99
use mithril_common::entities::{CompressionAlgorithm, ImmutableFileNumber};
1010

1111
use crate::{
12+
MithrilResult,
1213
file_downloader::{DownloadEvent, FileDownloader, FileDownloaderUri},
1314
utils::AncillaryVerifier,
14-
MithrilResult,
1515
};
1616

1717
/// The future type for downloading a file
@@ -90,8 +90,7 @@ impl DownloadTask {
9090
ancillary_verifier: &Arc<AncillaryVerifier>,
9191
logger: &Logger,
9292
) -> MithrilResult<()> {
93-
self.download_unpack_file(ancillary_files_temp_dir, logger)
94-
.await?;
93+
self.download_unpack_file(ancillary_files_temp_dir, logger).await?;
9594
let validated_manifest = ancillary_verifier.verify(ancillary_files_temp_dir).await?;
9695
validated_manifest.move_to_final_location(target_dir).await
9796
}
@@ -205,10 +204,7 @@ mod tests {
205204
kind: DownloadKind::Immutable(1),
206205
locations_to_try: create_locations_to_download(
207206
file_downloader,
208-
[
209-
"http://whatever-1/00001.tar.gz",
210-
"http://whatever-2/00001.tar.gz",
211-
],
207+
["http://whatever-1/00001.tar.gz", "http://whatever-2/00001.tar.gz"],
212208
),
213209
size_uncompressed: 0,
214210
target_dir: target_dir.clone(),
@@ -244,10 +240,7 @@ mod tests {
244240
kind: DownloadKind::Immutable(1),
245241
locations_to_try: create_locations_to_download(
246242
file_downloader,
247-
[
248-
"http://whatever-1/00001.tar.gz",
249-
"http://whatever-2/00001.tar.gz",
250-
],
243+
["http://whatever-1/00001.tar.gz", "http://whatever-2/00001.tar.gz"],
251244
),
252245
size_uncompressed: 0,
253246
target_dir: target_dir.clone(),
@@ -269,11 +262,7 @@ mod tests {
269262
use super::*;
270263

271264
fn fake_ancillary_verifier() -> AncillaryVerifier {
272-
AncillaryVerifier::new(
273-
fake_keys::manifest_verification_key()[0]
274-
.try_into()
275-
.unwrap(),
276-
)
265+
AncillaryVerifier::new(fake_keys::manifest_verification_key()[0].try_into().unwrap())
277266
}
278267

279268
#[tokio::test]

mithril-client/src/cardano_database_client/download_unpack/download_unpack_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use anyhow::anyhow;
55

66
use mithril_cardano_node_internal_database::{IMMUTABLE_DIR, LEDGER_DIR, VOLATILE_DIR};
77

8-
use crate::common::ImmutableFileNumber;
98
use crate::MithrilResult;
9+
use crate::common::ImmutableFileNumber;
1010

1111
/// Options for downloading and unpacking a Cardano database
1212
#[derive(Debug, Copy, Clone)]

mithril-client/src/cardano_database_client/download_unpack/internal_downloader.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ use mithril_common::messages::{
1111
AncillaryMessagePart, CardanoDatabaseSnapshotMessage, ImmutablesMessagePart,
1212
};
1313

14+
use crate::MithrilResult;
1415
use crate::cardano_database_client::ImmutableFileRange;
1516
use crate::feedback::{FeedbackSender, MithrilEvent, MithrilEventCardanoDatabase};
1617
use crate::file_downloader::{DownloadEvent, FileDownloader, FileDownloaderUri};
1718
use crate::utils::{
18-
create_bootstrap_node_files, AncillaryVerifier, UnexpectedDownloadedFileVerifier,
19-
VecDequeExtensions, ANCILLARIES_NOT_SIGNED_BY_MITHRIL,
19+
ANCILLARIES_NOT_SIGNED_BY_MITHRIL, AncillaryVerifier, UnexpectedDownloadedFileVerifier,
20+
VecDequeExtensions, create_bootstrap_node_files,
2021
};
21-
use crate::MithrilResult;
2222

23-
use super::download_task::{DownloadKind, DownloadTask, LocationToDownload};
2423
use super::DownloadUnpackOptions;
24+
use super::download_task::{DownloadKind, DownloadTask, LocationToDownload};
2525

2626
pub struct InternalArtifactDownloader {
2727
http_file_downloader: Arc<dyn FileDownloader>,
@@ -96,16 +96,17 @@ impl InternalArtifactDownloader {
9696
&download_id,
9797
)?);
9898
} else {
99-
slog::warn!(self.logger, "The fast bootstrap of the Cardano node is not available with the current parameters used in this command: the ledger state will be recomputed from genesis at startup of the Cardano node. Set the include_ancillary entry to true in the DownloadUnpackOptions.");
99+
slog::warn!(
100+
self.logger,
101+
"The fast bootstrap of the Cardano node is not available with the current parameters used in this command: the ledger state will be recomputed from genesis at startup of the Cardano node. Set the include_ancillary entry to true in the DownloadUnpackOptions."
102+
);
100103
}
101104

102105
// Return the result later so unexpected file removal is always run
103106
let download_result = self
104107
.batch_download_unpack(tasks, download_unpack_options.max_parallel_downloads)
105108
.await;
106-
expected_files_after_download
107-
.remove_unexpected_files()
108-
.await?;
109+
expected_files_after_download.remove_unexpected_files().await?;
109110
download_result?;
110111

111112
create_bootstrap_node_files(&self.logger, target_dir, &cardano_database_snapshot.network)?;
@@ -538,11 +539,7 @@ mod tests {
538539
use super::*;
539540

540541
fn fake_ancillary_verifier() -> AncillaryVerifier {
541-
AncillaryVerifier::new(
542-
fake_keys::manifest_verification_key()[0]
543-
.try_into()
544-
.unwrap(),
545-
)
542+
AncillaryVerifier::new(fake_keys::manifest_verification_key()[0].try_into().unwrap())
546543
}
547544

548545
#[tokio::test]

mithril-client/src/cardano_database_client/immutable_file_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::ops::RangeInclusive;
22

33
use anyhow::anyhow;
44

5-
use mithril_common::{entities::ImmutableFileNumber, StdResult};
5+
use mithril_common::{StdResult, entities::ImmutableFileNumber};
66

77
/// Immutable file range representation
88
#[derive(Debug, Eq, PartialEq)]

0 commit comments

Comments
 (0)