Skip to content

Commit 9cf8e78

Browse files
committed
fix some compiler warnings in binding
1 parent b9cb4fb commit 9cf8e78

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

bindings/src/adaptors/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use lightning::{
1616
util::ser::{Writer},
1717
ln::peer_handler::SocketDescriptor,
1818
ln::msgs::ErrorAction,
19-
chain::chaininterface::ChainWatchInterfaceUtil,
2019
ln::msgs::{ErrorMessage, RoutingMessageHandler, HTLCFailChannelUpdate, ChannelAnnouncement, NodeAnnouncement, LightningError, ChannelUpdate}
2120
};
2221

@@ -274,7 +273,7 @@ impl ChainWatchInterface for FFIChainWatchInterface {
274273
let mut matched_tx_index = [0; 9091];
275274
let mut matched_tx_index_len_ptr: &mut usize = &mut usize::MAX;
276275
(self.filter_block_ptr)(block_bytes.as_ptr(), block_bytes.len(), matched_tx_index.as_mut_ptr(), matched_tx_index_len_ptr as *mut _);
277-
if (matched_tx_index_len_ptr.clone() == usize::MAX) {
276+
if matched_tx_index_len_ptr.clone() == usize::MAX {
278277
panic!("FFI failure. the caller must set the actual serialized length of the tx-indexes in filter_block");
279278
}
280279
let mut matched_tx_indexes: &[usize] = unsafe_block!("We know the caller has set the value for serialized tx index" => &matched_tx_index[..(*matched_tx_index_len_ptr)]);
@@ -396,7 +395,7 @@ impl From<FFILightningError> for LightningError {
396395
fn from(v: FFILightningError) -> Self {
397396
let err = unsafe_block!("We know error msg is non-null c string" => CStr::from_ptr(v.err.as_ptr()) );
398397
LightningError {
399-
err: err.to_str().unwrap(),
398+
err: err.to_str().unwrap().to_owned(),
400399
action: v.action.into()
401400
}
402401
}

bindings/src/channelmanager.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
time::{SystemTime, UNIX_EPOCH}
55
};
66

7-
use bitcoin::{secp256k1, BlockHeader, Transaction};
87
use lightning::{
98
util::{
109
config::UserConfig,
@@ -20,7 +19,6 @@ use lightning::{
2019
},
2120
routing::router::Route,
2221
ln::channelmanager::{PaymentSecret, PaymentPreimage},
23-
chain::chaininterface::ChainListener
2422
};
2523

2624
use crate::{

0 commit comments

Comments
 (0)