Skip to content

Commit d70292d

Browse files
committed
Fix compilation warnings with --features=no-std
1 parent 7f83c55 commit d70292d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

lightning-invoice/src/utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use lightning::chain;
1010
use lightning::chain::chaininterface::{BroadcasterInterface, FeeEstimator};
1111
use lightning::chain::keysinterface::{Recipient, KeysInterface, Sign};
1212
use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
13-
use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, PaymentId, PaymentSendFailure, PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY, MIN_CLTV_EXPIRY_DELTA};
13+
use lightning::ln::channelmanager::{ChannelDetails, ChannelManager, PaymentId, PaymentSendFailure, MIN_FINAL_CLTV_EXPIRY};
14+
#[cfg(feature = "std")]
15+
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_CLTV_EXPIRY_DELTA};
1416
use lightning::ln::msgs::LightningError;
1517
use lightning::routing::scoring::Score;
1618
use lightning::routing::network_graph::{NetworkGraph, RoutingFees};

lightning/src/routing/router.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,9 +1537,9 @@ where L::Target: Logger {
15371537

15381538
#[cfg(test)]
15391539
mod tests {
1540-
use routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters, Score};
15411540
use routing::network_graph::{NetworkGraph, NetGraphMsgHandler, NodeId};
15421541
use routing::router::{get_route, PaymentParameters, Route, RouteHint, RouteHintHop, RouteHop, RoutingFees};
1542+
use routing::scoring::Score;
15431543
use chain::transaction::OutPoint;
15441544
use ln::features::{ChannelFeatures, InitFeatures, InvoiceFeatures, NodeFeatures};
15451545
use ln::msgs::{ErrorAction, LightningError, OptionalField, UnsignedChannelAnnouncement, ChannelAnnouncement, RoutingMessageHandler,
@@ -4970,6 +4970,8 @@ mod tests {
49704970
#[test]
49714971
#[cfg(not(feature = "no-std"))]
49724972
fn generate_routes() {
4973+
use routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters};
4974+
49734975
let mut d = match super::test_utils::get_route_file() {
49744976
Ok(f) => f,
49754977
Err(e) => {
@@ -5002,6 +5004,8 @@ mod tests {
50025004
#[test]
50035005
#[cfg(not(feature = "no-std"))]
50045006
fn generate_routes_mpp() {
5007+
use routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters};
5008+
50055009
let mut d = match super::test_utils::get_route_file() {
50065010
Ok(f) => f,
50075011
Err(e) => {

lightning/src/util/test_utils.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ impl events::MessageSendEventsProvider for TestRoutingMessageHandler {
411411

412412
pub struct TestLogger {
413413
level: Level,
414+
#[cfg(feature = "std")]
414415
id: String,
416+
#[cfg(not(feature = "std"))]
417+
_id: String,
415418
pub lines: Mutex<HashMap<(String, String), usize>>,
416419
}
417420

@@ -422,7 +425,10 @@ impl TestLogger {
422425
pub fn with_id(id: String) -> TestLogger {
423426
TestLogger {
424427
level: Level::Trace,
428+
#[cfg(feature = "std")]
425429
id,
430+
#[cfg(not(feature = "std"))]
431+
_id: id,
426432
lines: Mutex::new(HashMap::new())
427433
}
428434
}

0 commit comments

Comments
 (0)