Skip to content

Commit 39a978b

Browse files
committed
Fix warnings when not using 'fs' feature
1 parent e917080 commit 39a978b

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

mithril-client/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ impl ClientBuilder {
153153
aggregator_client,
154154
#[cfg(feature = "fs")]
155155
snapshot_downloader,
156+
#[cfg(feature = "fs")]
156157
feedback_sender,
158+
#[cfg(feature = "fs")]
157159
logger,
158160
));
159161

mithril-client/src/message.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
use anyhow::Context;
2+
#[cfg(feature = "fs")]
23
use mithril_common::digesters::{CardanoImmutableDigester, ImmutableDigester};
34
use mithril_common::entities::{ProtocolMessage, ProtocolMessagePartKey};
45
use mithril_common::messages::SignerWithStakeMessagePart;
56
use mithril_common::protocol::SignerBuilder;
67
use slog::{o, Logger};
8+
#[cfg(feature = "fs")]
79
use std::path::Path;
10+
#[cfg(feature = "fs")]
811
use std::sync::Arc;
912

10-
use crate::{MithrilCertificate, MithrilResult, MithrilStakeDistribution};
13+
#[cfg(feature = "fs")]
14+
use crate::MithrilCertificate;
15+
use crate::{MithrilResult, MithrilStakeDistribution};
1116

1217
/// A [MessageBuilder] can be used to compute the message of Mithril artifacts.
1318
pub struct MessageBuilder {
19+
#[cfg(feature = "fs")]
1420
immutable_digester: Option<Arc<dyn ImmutableDigester>>,
1521
logger: Logger,
1622
}
@@ -20,6 +26,7 @@ impl MessageBuilder {
2026
pub fn new() -> MessageBuilder {
2127
let logger = Logger::root(slog::Discard, o!());
2228
Self {
29+
#[cfg(feature = "fs")]
2330
immutable_digester: None,
2431
logger,
2532
}

mithril-client/src/snapshot_client.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@
6464
//! ```
6565
6666
use anyhow::Context;
67+
#[cfg(feature = "fs")]
6768
use slog::Logger;
6869
use std::sync::Arc;
6970
use thiserror::Error;
7071

7172
use crate::aggregator_client::{AggregatorClient, AggregatorClientError, AggregatorRequest};
73+
#[cfg(feature = "fs")]
7274
use crate::feedback::FeedbackSender;
7375
#[cfg(feature = "fs")]
7476
use crate::snapshot_downloader::SnapshotDownloader;
@@ -93,7 +95,9 @@ pub struct SnapshotClient {
9395
aggregator_client: Arc<dyn AggregatorClient>,
9496
#[cfg(feature = "fs")]
9597
snapshot_downloader: Arc<dyn SnapshotDownloader>,
98+
#[cfg(feature = "fs")]
9699
feedback_sender: FeedbackSender,
100+
#[cfg(feature = "fs")]
97101
logger: Logger,
98102
}
99103

@@ -102,14 +106,16 @@ impl SnapshotClient {
102106
pub fn new(
103107
aggregator_client: Arc<dyn AggregatorClient>,
104108
#[cfg(feature = "fs")] snapshot_downloader: Arc<dyn SnapshotDownloader>,
105-
feedback_sender: FeedbackSender,
106-
logger: Logger,
109+
#[cfg(feature = "fs")] feedback_sender: FeedbackSender,
110+
#[cfg(feature = "fs")] logger: Logger,
107111
) -> Self {
108112
Self {
109113
aggregator_client,
110114
#[cfg(feature = "fs")]
111115
snapshot_downloader,
116+
#[cfg(feature = "fs")]
112117
feedback_sender,
118+
#[cfg(feature = "fs")]
113119
logger,
114120
}
115121
}

0 commit comments

Comments
 (0)