Skip to content

Commit 24db35e

Browse files
authored
Merge pull request #2568 from tnull/2023-09-housekeeping
Housekeeping: fix some warning and docs
2 parents 51d5ead + 411a3f7 commit 24db35e

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

lightning-net-tokio/src/lib.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131

3232
use bitcoin::secp256k1::PublicKey;
3333

34-
use tokio::net::{tcp, TcpStream};
35-
use tokio::{io, time};
34+
use tokio::net::TcpStream;
35+
use tokio::time;
3636
use tokio::sync::mpsc;
37-
use tokio::io::AsyncWrite;
3837

3938
use lightning::ln::peer_handler;
4039
use lightning::ln::peer_handler::SocketDescriptor as LnSocketTrait;
@@ -231,7 +230,7 @@ impl Connection {
231230
// readable() is allowed to spuriously wake, so we have to handle
232231
// WouldBlock here.
233232
},
234-
Err(e) => break Disconnect::PeerDisconnected,
233+
Err(_) => break Disconnect::PeerDisconnected,
235234
}
236235
},
237236
}
@@ -493,10 +492,10 @@ impl peer_handler::SocketDescriptor for SocketDescriptor {
493492
written_len += res;
494493
if written_len == data.len() { return written_len; }
495494
},
496-
Err(e) => return written_len,
495+
Err(_) => return written_len,
497496
}
498497
},
499-
task::Poll::Ready(Err(e)) => return written_len,
498+
task::Poll::Ready(Err(_)) => return written_len,
500499
task::Poll::Pending => {
501500
// We're queued up for a write event now, but we need to make sure we also
502501
// pause read given we're now waiting on the remote end to ACK (and in

lightning/src/ln/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
#[macro_use]
1414
pub mod functional_test_utils;
1515

16-
pub mod channel_id;
1716
pub mod channelmanager;
1817
pub mod inbound_payment;
1918
pub mod msgs;
2019
pub mod peer_handler;
2120
pub mod chan_utils;
2221
pub mod features;
2322
pub mod script;
23+
mod channel_id;
2424

2525
#[cfg(fuzzing)]
2626
pub mod peer_channel_encryptor;
@@ -33,7 +33,7 @@ pub mod channel;
3333
pub(crate) mod channel;
3434

3535
// Re-export ChannelId
36-
pub use self::channel_id::ChannelId;
36+
pub use channel_id::ChannelId;
3737

3838
pub(crate) mod onion_utils;
3939
mod outbound_payment;

lightning/src/ln/monitor_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ fn test_anchors_aggregated_revoked_htlc_tx() {
22312231
assert!(nodes[1].chain_monitor.chain_monitor.get_and_clear_pending_events().is_empty());
22322232
let spendable_output_events = nodes[0].chain_monitor.chain_monitor.get_and_clear_pending_events();
22332233
assert_eq!(spendable_output_events.len(), 2);
2234-
for (idx, event) in spendable_output_events.iter().enumerate() {
2234+
for event in spendable_output_events.iter() {
22352235
if let Event::SpendableOutputs { outputs, channel_id } = event {
22362236
assert_eq!(outputs.len(), 1);
22372237
assert!(vec![chan_b.2, chan_a.2].contains(&channel_id.unwrap()));

lightning/src/ln/shutdown_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
use crate::sign::{EntropySource, SignerProvider};
1313
use crate::chain::transaction::OutPoint;
14-
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, ClosureReason};
14+
use crate::events::{MessageSendEvent, MessageSendEventsProvider, ClosureReason};
1515
use crate::ln::channelmanager::{self, PaymentSendFailure, PaymentId, RecipientOnionFields, ChannelShutdownState, ChannelDetails};
1616
use crate::routing::router::{PaymentParameters, get_route, RouteParameters};
1717
use crate::ln::msgs;

lightning/src/util/test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl<Signer: sign::WriteableEcdsaChannelSigner> chainmonitor::Persist<Signer> fo
427427
}
428428
}
429429

430-
pub(crate) struct TestStore {
430+
pub struct TestStore {
431431
persisted_bytes: Mutex<HashMap<String, HashMap<String, Vec<u8>>>>,
432432
read_only: bool,
433433
}

0 commit comments

Comments
 (0)