Skip to content

Commit cc70a7d

Browse files
committed
Revert "Allow unused imports for traits used in macros"
This reverts commit 42ea2e9. The commit spuriously concluded that the unused import warnings were due to trait use in macros, but actually they were all used in normal code, not in macros. This appears to simply be a clippy bug where it treats `as _` as indication that an import is unused, even though such imports are useful for importing traits that do not need to be referenced by name.
1 parent 3840ff6 commit cc70a7d

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

lightning-block-sync/src/lib.rs

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

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

5554
use std::future::Future;
5655
use std::ops::Deref;

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ use crate::chain::channelmonitor::{
3333
WithChannelMonitor,
3434
};
3535
use crate::chain::transaction::{OutPoint, TransactionData};
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};
36+
use crate::chain::{ChannelMonitorUpdateStatus, Filter, WatchedOutput};
3937
use crate::events::{self, Event, EventHandler, ReplayEvent};
4038
use crate::ln::channel_state::ChannelDetails;
4139
use crate::ln::msgs::{self, BaseMessageHandler, Init, MessageSendEvent, SendOnlyMessageHandler};

lightning/src/chain/channelmonitor.rs

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

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ use crate::chain::channelmonitor::{
5050
LATENCY_GRACE_PERIOD_BLOCKS, MAX_BLOCKS_FOR_CONF,
5151
};
5252
use crate::chain::transaction::{OutPoint, TransactionData};
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};
53+
use crate::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm, Watch};
5654
use crate::events::{
5755
self, ClosureReason, Event, EventHandler, EventsProvider, HTLCHandlingFailureType,
5856
InboundChannelFunds, PaymentFailureReason, ReplayEvent,

0 commit comments

Comments
 (0)