Skip to content

Commit 42ea2e9

Browse files
committed
Allow unused imports for traits used in macros
1 parent 9d66258 commit 42ea2e9

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ use bitcoin::hash_types::BlockHash;
4949
use bitcoin::pow::Work;
5050

5151
use lightning::chain;
52-
use lightning::chain::Listen;
52+
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
53+
use lightning::chain::Listen as _;
5354

5455
use std::future::Future;
5556
use std::ops::Deref;

lightning/src/chain/chainmonitor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ use crate::chain::channelmonitor::{
3333
WithChannelMonitor,
3434
};
3535
use crate::chain::transaction::{OutPoint, TransactionData};
36-
use crate::chain::{ChannelMonitorUpdateStatus, Filter, WatchedOutput};
36+
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
37+
use crate::chain::Filter as _;
38+
use crate::chain::{ChannelMonitorUpdateStatus, WatchedOutput};
3739
use crate::events::{self, Event, EventHandler, ReplayEvent};
3840
use crate::ln::channel_state::ChannelDetails;
3941
use crate::ln::msgs::{self, BaseMessageHandler, Init, MessageSendEvent, SendOnlyMessageHandler};

lightning/src/chain/channelmonitor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ use crate::chain::package::{
4242
HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedHTLCOutput, RevokedOutput,
4343
};
4444
use crate::chain::transaction::{OutPoint, TransactionData};
45-
use crate::chain::Filter;
45+
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
46+
use crate::chain::Filter as _;
4647
use crate::chain::{BestBlock, WatchedOutput};
4748
use crate::events::bump_transaction::{AnchorDescriptor, BumpTransactionEvent};
4849
use crate::events::{ClosureReason, Event, EventHandler, ReplayEvent};

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ use crate::chain::channelmonitor::{
5050
LATENCY_GRACE_PERIOD_BLOCKS, MAX_BLOCKS_FOR_CONF,
5151
};
5252
use crate::chain::transaction::{OutPoint, TransactionData};
53-
use crate::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm, Watch};
53+
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
54+
use crate::chain::Watch as _;
55+
use crate::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm};
5456
use crate::events::{
5557
self, ClosureReason, Event, EventHandler, EventsProvider, HTLCHandlingFailureType,
5658
InboundChannelFunds, PaymentFailureReason, ReplayEvent,

0 commit comments

Comments
 (0)