Skip to content

Commit 1d1323a

Browse files
committed
Fix build warnings
1 parent 8408b8d commit 1d1323a

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

fuzz/src/full_stack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use lightning::ln::msgs::{self, DecodeError};
4242
use lightning::ln::script::ShutdownScript;
4343
use lightning::routing::gossip::{P2PGossipSync, NetworkGraph};
4444
use lightning::routing::utxo::UtxoLookup;
45-
use lightning::routing::router::{find_route, InFlightHtlcs, PaymentParameters, Route, RouteHop, RouteParameters, Router};
45+
use lightning::routing::router::{find_route, InFlightHtlcs, PaymentParameters, Route, RouteParameters, Router};
4646
use lightning::routing::scoring::FixedPenaltyScorer;
4747
use lightning::util::config::UserConfig;
4848
use lightning::util::errors::APIError;

lightning-background-processor/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
3333
use lightning::routing::utxo::UtxoLookup;
3434
use lightning::routing::router::Router;
3535
use lightning::routing::scoring::{Score, WriteableScore};
36-
use lightning::util::events::{Event, EventHandler, EventsProvider, PathFailure};
36+
use lightning::util::events::{Event, PathFailure};
37+
#[cfg(feature = "std")]
38+
use lightning::util::events::{EventHandler, EventsProvider};
3739
use lightning::util::logger::Logger;
3840
use lightning::util::persist::Persister;
3941
use lightning_rapid_gossip_sync::RapidGossipSync;

lightning-rapid-gossip-sync/src/processing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
4242
&self,
4343
read_cursor: &mut R,
4444
) -> Result<u32, GraphSyncError> {
45-
#[allow(unused_mut)]
45+
#[allow(unused_mut, unused_assignments)]
4646
let mut current_time_unix = None;
4747
#[cfg(all(feature = "std", not(test)))]
4848
{

lightning/src/ln/channelmanager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3982,7 +3982,7 @@ where
39823982
None => None
39833983
};
39843984

3985-
let mut peer_state_opt = counterparty_node_id_opt.as_ref().map(
3985+
let peer_state_opt = counterparty_node_id_opt.as_ref().map(
39863986
|counterparty_node_id| per_peer_state.get(counterparty_node_id).map(
39873987
|peer_mutex| peer_mutex.lock().unwrap()
39883988
)

lightning/src/ln/outbound_payment.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ pub(crate) struct PaymentAttemptsUsingTime<T: Time> {
276276
/// it means the result of the first attempt is not known yet.
277277
pub(crate) count: usize,
278278
/// This field is only used when retry is `Retry::Timeout` which is only build with feature std
279-
first_attempted_at: T
279+
#[cfg(not(feature = "no-std"))]
280+
first_attempted_at: T,
281+
#[cfg(feature = "no-std")]
282+
phantom: core::marker::PhantomData<T>,
283+
280284
}
281285

282286
#[cfg(not(any(feature = "no-std", test)))]
@@ -290,7 +294,10 @@ impl<T: Time> PaymentAttemptsUsingTime<T> {
290294
pub(crate) fn new() -> Self {
291295
PaymentAttemptsUsingTime {
292296
count: 0,
293-
first_attempted_at: T::now()
297+
#[cfg(not(feature = "no-std"))]
298+
first_attempted_at: T::now(),
299+
#[cfg(feature = "no-std")]
300+
phantom: core::marker::PhantomData,
294301
}
295302
}
296303
}

lightning/src/sync/debug_sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl LockMetadata {
129129
// For each lock which is currently locked, check that no lock's locked-before
130130
// set includes the lock we're about to lock, which would imply a lockorder
131131
// inversion.
132-
for (locked_idx, locked) in held.borrow().iter() {
132+
for (locked_idx, _locked) in held.borrow().iter() {
133133
if *locked_idx == this.lock_idx {
134134
// Note that with `feature = "backtrace"` set, we may be looking at different
135135
// instances of the same lock. Still, doing so is quite risky, a total order
@@ -143,7 +143,7 @@ impl LockMetadata {
143143
panic!("Tried to acquire a lock while it was held!");
144144
}
145145
}
146-
for (locked_idx, locked) in held.borrow().iter() {
146+
for (_locked_idx, locked) in held.borrow().iter() {
147147
for (locked_dep_idx, _locked_dep) in locked.locked_before.lock().unwrap().iter() {
148148
if *locked_dep_idx == this.lock_idx && *locked_dep_idx != locked.lock_idx {
149149
#[cfg(feature = "backtrace")]

lightning/src/sync/fairrwlock.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl<T> FairRwLock<T> {
4545
self.lock.read()
4646
}
4747

48+
#[allow(dead_code)]
4849
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<'_, T>> {
4950
self.lock.try_write()
5051
}

lightning/src/sync/test_lockorder_checks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::sync::debug_sync::{RwLock, Mutex};
33
use super::{LockHeldState, LockTestExt};
44

55
use std::sync::Arc;
6-
use std::thread;
76

87
#[test]
98
#[should_panic]

0 commit comments

Comments
 (0)