Skip to content

Commit 326f555

Browse files
committed
Fix unused (import) warnings in no-std builds
1 parent 4d9da3a commit 326f555

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

lightning/src/ln/payment_tests.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ use crate::ln::functional_test_utils;
4343
use crate::ln::functional_test_utils::*;
4444
use crate::routing::gossip::NodeId;
4545
#[cfg(feature = "std")]
46-
use {
47-
crate::util::time::tests::SinceEpoch,
48-
std::time::{SystemTime, Instant, Duration}
49-
};
46+
use std::time::{SystemTime, Instant, Duration};
47+
#[cfg(not(feature = "no-std"))]
48+
use crate::util::time::tests::SinceEpoch;
5049

5150
#[test]
5251
fn mpp_failure() {

lightning/src/ln/reload_tests.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ use crate::chain::channelmonitor::{CLOSED_CHANNEL_UPDATE_ID, ChannelMonitor};
1515
use crate::sign::EntropySource;
1616
use crate::chain::transaction::OutPoint;
1717
use crate::events::{ClosureReason, Event, HTLCDestination, MessageSendEvent, MessageSendEventsProvider};
18-
use crate::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, PaymentId, Retry, RecipientOnionFields};
18+
use crate::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs, PaymentId, RecipientOnionFields};
1919
use crate::ln::msgs;
2020
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler, ErrorAction};
21-
use crate::routing::router::{RouteParameters, PaymentParameters};
2221
use crate::util::test_channel_signer::TestChannelSigner;
2322
use crate::util::test_utils;
2423
use crate::util::errors::APIError;
2524
use crate::util::ser::{Writeable, ReadableArgs};
2625
use crate::util::config::UserConfig;
27-
use crate::util::string::UntrustedString;
2826

2927
use bitcoin::hash_types::BlockHash;
3028

@@ -496,6 +494,9 @@ fn test_manager_serialize_deserialize_inconsistent_monitor() {
496494

497495
#[cfg(feature = "std")]
498496
fn do_test_data_loss_protect(reconnect_panicing: bool, substantially_old: bool, not_stale: bool) {
497+
use crate::routing::router::{RouteParameters, PaymentParameters};
498+
use crate::ln::channelmanager::Retry;
499+
use crate::util::string::UntrustedString;
499500
// When we get a data_loss_protect proving we're behind, we immediately panic as the
500501
// chain::Watch API requirements have been violated (e.g. the user restored from a backup). The
501502
// panic message informs the user they should force-close without broadcasting, which is tested

lightning/src/sync/nostd_sync.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ impl<T> Mutex<T> {
3737
Ok(MutexGuard { lock: self.inner.borrow_mut() })
3838
}
3939

40-
pub fn try_lock<'a>(&'a self) -> LockResult<MutexGuard<'a, T>> {
41-
Ok(MutexGuard { lock: self.inner.borrow_mut() })
42-
}
43-
4440
pub fn into_inner(self) -> LockResult<T> {
4541
Ok(self.inner.into_inner())
4642
}

0 commit comments

Comments
 (0)