Skip to content

Commit 9d66258

Browse files
committed
Fix clippy::mismatched-lifetime-syntaxes
Hiding a lifetime that's elided elsewhere is confusing. See: rust-lang/rust#138677
1 parent 381416a commit 9d66258

File tree

20 files changed

+73
-73
lines changed

20 files changed

+73
-73
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub trait BlockSource: Sync + Send {
7878
/// to allow for a more efficient lookup.
7979
///
8080
/// [`get_header`]: Self::get_header
81-
fn get_best_block(&self) -> AsyncBlockSourceResult<(BlockHash, Option<u32>)>;
81+
fn get_best_block(&self) -> AsyncBlockSourceResult<'_, (BlockHash, Option<u32>)>;
8282
}
8383

8484
/// Result type for `BlockSource` requests.

lightning-invoice/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ impl RawBolt11Invoice {
11461146
/// This is not exported to bindings users as there is not yet a manual mapping for a FilterMap
11471147
pub fn known_tagged_fields(
11481148
&self,
1149-
) -> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
1149+
) -> FilterMap<Iter<'_, RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
11501150
// For 1.14.0 compatibility: closures' types can't be written an fn()->() in the
11511151
// function's type signature.
11521152
// TODO: refactor once impl Trait is available
@@ -1468,7 +1468,7 @@ impl Bolt11Invoice {
14681468
/// This is not exported to bindings users as there is not yet a manual mapping for a FilterMap
14691469
pub fn tagged_fields(
14701470
&self,
1471-
) -> FilterMap<Iter<RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
1471+
) -> FilterMap<Iter<'_, RawTaggedField>, fn(&RawTaggedField) -> Option<&TaggedField>> {
14721472
self.signed_invoice.raw_invoice().known_tagged_fields()
14731473
}
14741474

@@ -1480,7 +1480,7 @@ impl Bolt11Invoice {
14801480
/// Return the description or a hash of it for longer ones
14811481
///
14821482
/// This is not exported to bindings users because we don't yet export Bolt11InvoiceDescription
1483-
pub fn description(&self) -> Bolt11InvoiceDescriptionRef {
1483+
pub fn description(&self) -> Bolt11InvoiceDescriptionRef<'_> {
14841484
if let Some(direct) = self.signed_invoice.description() {
14851485
return Bolt11InvoiceDescriptionRef::Direct(direct);
14861486
} else if let Some(hash) = self.signed_invoice.description_hash() {

lightning-liquidity/src/events/event_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl EventQueue {
6767
}
6868

6969
// Returns an [`EventQueueNotifierGuard`] that will notify about new event when dropped.
70-
pub fn notifier(&self) -> EventQueueNotifierGuard {
70+
pub fn notifier(&self) -> EventQueueNotifierGuard<'_> {
7171
EventQueueNotifierGuard(self)
7272
}
7373
}

lightning-liquidity/src/message_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl MessageQueue {
3333
self.pending_msgs_notifier.get_future()
3434
}
3535

36-
pub(crate) fn notifier(&self) -> MessageQueueNotifierGuard {
36+
pub(crate) fn notifier(&self) -> MessageQueueNotifierGuard<'_> {
3737
MessageQueueNotifierGuard { msg_queue: self, buffer: VecDeque::new() }
3838
}
3939
}

lightning/src/ln/chan_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ impl ChannelTransactionParameters {
10351035
///
10361036
/// self.is_populated() must be true before calling this function.
10371037
#[rustfmt::skip]
1038-
pub fn as_holder_broadcastable(&self) -> DirectedChannelTransactionParameters {
1038+
pub fn as_holder_broadcastable(&self) -> DirectedChannelTransactionParameters<'_> {
10391039
assert!(self.is_populated(), "self.late_parameters must be set before using as_holder_broadcastable");
10401040
DirectedChannelTransactionParameters {
10411041
inner: self,
@@ -1048,7 +1048,7 @@ impl ChannelTransactionParameters {
10481048
///
10491049
/// self.is_populated() must be true before calling this function.
10501050
#[rustfmt::skip]
1051-
pub fn as_counterparty_broadcastable(&self) -> DirectedChannelTransactionParameters {
1051+
pub fn as_counterparty_broadcastable(&self) -> DirectedChannelTransactionParameters<'_> {
10521052
assert!(self.is_populated(), "self.late_parameters must be set before using as_counterparty_broadcastable");
10531053
DirectedChannelTransactionParameters {
10541054
inner: self,
@@ -1435,7 +1435,7 @@ impl ClosingTransaction {
14351435
///
14361436
/// This should only be used if you fully trust the builder of this object. It should not
14371437
/// be used by an external signer - instead use the verify function.
1438-
pub fn trust(&self) -> TrustedClosingTransaction {
1438+
pub fn trust(&self) -> TrustedClosingTransaction<'_> {
14391439
TrustedClosingTransaction { inner: self }
14401440
}
14411441

@@ -1446,7 +1446,7 @@ impl ClosingTransaction {
14461446
/// An external validating signer must call this method before signing
14471447
/// or using the built transaction.
14481448
#[rustfmt::skip]
1449-
pub fn verify(&self, funding_outpoint: OutPoint) -> Result<TrustedClosingTransaction, ()> {
1449+
pub fn verify(&self, funding_outpoint: OutPoint) -> Result<TrustedClosingTransaction<'_>, ()> {
14501450
let built = build_closing_transaction(
14511451
self.to_holder_value_sat, self.to_counterparty_value_sat,
14521452
self.to_holder_script.clone(), self.to_counterparty_script.clone(),
@@ -1971,7 +1971,7 @@ impl CommitmentTransaction {
19711971
///
19721972
/// This should only be used if you fully trust the builder of this object. It should not
19731973
/// be used by an external signer - instead use the verify function.
1974-
pub fn trust(&self) -> TrustedCommitmentTransaction {
1974+
pub fn trust(&self) -> TrustedCommitmentTransaction<'_> {
19751975
TrustedCommitmentTransaction { inner: self }
19761976
}
19771977

@@ -1982,7 +1982,7 @@ impl CommitmentTransaction {
19821982
/// An external validating signer must call this method before signing
19831983
/// or using the built transaction.
19841984
#[rustfmt::skip]
1985-
pub fn verify<T: secp256k1::Signing + secp256k1::Verification>(&self, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<T>) -> Result<TrustedCommitmentTransaction, ()> {
1985+
pub fn verify<T: secp256k1::Signing + secp256k1::Verification>(&self, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<T>) -> Result<TrustedCommitmentTransaction<'_>, ()> {
19861986
// This is the only field of the key cache that we trust
19871987
let per_commitment_point = &self.keys.per_commitment_point;
19881988
let keys = TxCreationKeys::from_channel_static_keys(per_commitment_point, channel_parameters.broadcaster_pubkeys(), channel_parameters.countersignatory_pubkeys(), secp_ctx);

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4534,7 +4534,7 @@ where
45344534
/// which peer generated this transaction and "to whom" this transaction flows.
45354535
#[inline]
45364536
#[rustfmt::skip]
4537-
fn build_commitment_transaction<L: Deref>(&self, funding: &FundingScope, commitment_number: u64, per_commitment_point: &PublicKey, local: bool, generated_by_local: bool, logger: &L) -> CommitmentData
4537+
fn build_commitment_transaction<L: Deref>(&self, funding: &FundingScope, commitment_number: u64, per_commitment_point: &PublicKey, local: bool, generated_by_local: bool, logger: &L) -> CommitmentData<'_>
45384538
where L::Target: Logger
45394539
{
45404540
let broadcaster_dust_limit_sat = if local { self.holder_dust_limit_satoshis } else { self.counterparty_dust_limit_satoshis };
@@ -11817,7 +11817,7 @@ where
1181711817
}
1181811818
}
1181911819

11820-
pub fn remove_legacy_scids_before_block(&mut self, height: u32) -> alloc::vec::Drain<u64> {
11820+
pub fn remove_legacy_scids_before_block(&mut self, height: u32) -> alloc::vec::Drain<'_, u64> {
1182111821
let end = self
1182211822
.funding
1182311823
.get_short_channel_id()

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11897,9 +11897,9 @@ where
1189711897
L::Target: Logger,
1189811898
{
1189911899
#[cfg(not(c_bindings))]
11900-
create_offer_builder!(self, OfferBuilder<DerivedMetadata, secp256k1::All>);
11900+
create_offer_builder!(self, OfferBuilder<'_, DerivedMetadata, secp256k1::All>);
1190111901
#[cfg(not(c_bindings))]
11902-
create_refund_builder!(self, RefundBuilder<secp256k1::All>);
11902+
create_refund_builder!(self, RefundBuilder<'_, secp256k1::All>);
1190311903

1190411904
#[cfg(c_bindings)]
1190511905
create_offer_builder!(self, OfferWithDerivedMetadataBuilder);

lightning/src/ln/functional_test_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ pub trait NodeHolder {
718718
<Self::CM as AChannelManager>::MR,
719719
<Self::CM as AChannelManager>::L,
720720
>;
721-
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor>;
721+
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor<'_>>;
722722
}
723723
impl<H: NodeHolder> NodeHolder for &H {
724724
type CM = H::CM;
@@ -737,7 +737,7 @@ impl<H: NodeHolder> NodeHolder for &H {
737737
> {
738738
(*self).node()
739739
}
740-
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor> {
740+
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor<'_>> {
741741
(*self).chain_monitor()
742742
}
743743
}
@@ -746,7 +746,7 @@ impl<'a, 'b: 'a, 'c: 'b> NodeHolder for Node<'a, 'b, 'c> {
746746
fn node(&self) -> &TestChannelManager<'b, 'c> {
747747
&self.node
748748
}
749-
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor> {
749+
fn chain_monitor(&self) -> Option<&test_utils::TestChainMonitor<'_>> {
750750
Some(self.chain_monitor)
751751
}
752752
}

lightning/src/offers/flow.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ where
525525

526526
fn create_offer_builder_intern<ES: Deref, PF, I>(
527527
&self, entropy_source: ES, make_paths: PF,
528-
) -> Result<(OfferBuilder<DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError>
528+
) -> Result<(OfferBuilder<'_, DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError>
529529
where
530530
ES::Target: EntropySource,
531531
PF: FnOnce(
@@ -580,7 +580,7 @@ where
580580
/// [`DefaultMessageRouter`]: crate::onion_message::messenger::DefaultMessageRouter
581581
pub fn create_offer_builder<ES: Deref>(
582582
&self, entropy_source: ES, peers: Vec<MessageForwardNode>,
583-
) -> Result<OfferBuilder<DerivedMetadata, secp256k1::All>, Bolt12SemanticError>
583+
) -> Result<OfferBuilder<'_, DerivedMetadata, secp256k1::All>, Bolt12SemanticError>
584584
where
585585
ES::Target: EntropySource,
586586
{
@@ -601,7 +601,7 @@ where
601601
/// See [`Self::create_offer_builder`] for more details on usage.
602602
pub fn create_offer_builder_using_router<ME: Deref, ES: Deref>(
603603
&self, router: ME, entropy_source: ES, peers: Vec<MessageForwardNode>,
604-
) -> Result<OfferBuilder<DerivedMetadata, secp256k1::All>, Bolt12SemanticError>
604+
) -> Result<OfferBuilder<'_, DerivedMetadata, secp256k1::All>, Bolt12SemanticError>
605605
where
606606
ME::Target: MessageRouter,
607607
ES::Target: EntropySource,
@@ -627,7 +627,7 @@ where
627627
#[cfg(async_payments)]
628628
pub fn create_async_receive_offer_builder<ES: Deref>(
629629
&self, entropy_source: ES, message_paths_to_always_online_node: Vec<BlindedMessagePath>,
630-
) -> Result<(OfferBuilder<DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError>
630+
) -> Result<(OfferBuilder<'_, DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError>
631631
where
632632
ES::Target: EntropySource,
633633
{
@@ -639,7 +639,7 @@ where
639639
fn create_refund_builder_intern<ES: Deref, PF, I>(
640640
&self, entropy_source: ES, make_paths: PF, amount_msats: u64, absolute_expiry: Duration,
641641
payment_id: PaymentId,
642-
) -> Result<RefundBuilder<secp256k1::All>, Bolt12SemanticError>
642+
) -> Result<RefundBuilder<'_, secp256k1::All>, Bolt12SemanticError>
643643
where
644644
ES::Target: EntropySource,
645645
PF: FnOnce(
@@ -712,7 +712,7 @@ where
712712
pub fn create_refund_builder<ES: Deref>(
713713
&self, entropy_source: ES, amount_msats: u64, absolute_expiry: Duration,
714714
payment_id: PaymentId, peers: Vec<MessageForwardNode>,
715-
) -> Result<RefundBuilder<secp256k1::All>, Bolt12SemanticError>
715+
) -> Result<RefundBuilder<'_, secp256k1::All>, Bolt12SemanticError>
716716
where
717717
ES::Target: EntropySource,
718718
{
@@ -751,7 +751,7 @@ where
751751
pub fn create_refund_builder_using_router<ES: Deref, ME: Deref>(
752752
&self, router: ME, entropy_source: ES, amount_msats: u64, absolute_expiry: Duration,
753753
payment_id: PaymentId, peers: Vec<MessageForwardNode>,
754-
) -> Result<RefundBuilder<secp256k1::All>, Bolt12SemanticError>
754+
) -> Result<RefundBuilder<'_, secp256k1::All>, Bolt12SemanticError>
755755
where
756756
ME::Target: MessageRouter,
757757
ES::Target: EntropySource,

lightning/src/offers/invoice.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
836836
/// From [`Offer::description`] or [`Refund::description`].
837837
///
838838
/// [`Offer::description`]: crate::offers::offer::Offer::description
839-
pub fn description(&$self) -> Option<PrintableString> {
839+
pub fn description(&$self) -> Option<PrintableString<'_>> {
840840
$contents.description()
841841
}
842842

@@ -854,7 +854,7 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
854854
/// From [`Offer::issuer`] or [`Refund::issuer`].
855855
///
856856
/// [`Offer::issuer`]: crate::offers::offer::Offer::issuer
857-
pub fn issuer(&$self) -> Option<PrintableString> {
857+
pub fn issuer(&$self) -> Option<PrintableString<'_>> {
858858
$contents.issuer()
859859
}
860860

@@ -919,7 +919,7 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
919919
/// A payer-provided note reflected back in the invoice.
920920
///
921921
/// From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
922-
pub fn payer_note(&$self) -> Option<PrintableString> {
922+
pub fn payer_note(&$self) -> Option<PrintableString<'_>> {
923923
$contents.payer_note()
924924
}
925925

@@ -1019,7 +1019,7 @@ impl Bolt12Invoice {
10191019
)
10201020
}
10211021

1022-
pub(crate) fn as_tlv_stream(&self) -> FullInvoiceTlvStreamRef {
1022+
pub(crate) fn as_tlv_stream(&self) -> FullInvoiceTlvStreamRef<'_> {
10231023
let (
10241024
payer_tlv_stream,
10251025
offer_tlv_stream,
@@ -1127,7 +1127,7 @@ impl InvoiceContents {
11271127
}
11281128
}
11291129

1130-
fn description(&self) -> Option<PrintableString> {
1130+
fn description(&self) -> Option<PrintableString<'_>> {
11311131
match self {
11321132
InvoiceContents::ForOffer { invoice_request, .. } => {
11331133
invoice_request.inner.offer.description()
@@ -1154,7 +1154,7 @@ impl InvoiceContents {
11541154
}
11551155
}
11561156

1157-
fn issuer(&self) -> Option<PrintableString> {
1157+
fn issuer(&self) -> Option<PrintableString<'_>> {
11581158
match self {
11591159
InvoiceContents::ForOffer { invoice_request, .. } => {
11601160
invoice_request.inner.offer.issuer()
@@ -1220,7 +1220,7 @@ impl InvoiceContents {
12201220
}
12211221
}
12221222

1223-
fn payer_note(&self) -> Option<PrintableString> {
1223+
fn payer_note(&self) -> Option<PrintableString<'_>> {
12241224
match self {
12251225
InvoiceContents::ForOffer { invoice_request, .. } => invoice_request.payer_note(),
12261226
InvoiceContents::ForRefund { refund, .. } => refund.payer_note(),
@@ -1315,7 +1315,7 @@ impl InvoiceContents {
13151315
)
13161316
}
13171317

1318-
fn as_tlv_stream(&self) -> PartialInvoiceTlvStreamRef {
1318+
fn as_tlv_stream(&self) -> PartialInvoiceTlvStreamRef<'_> {
13191319
let (payer, offer, invoice_request, experimental_offer, experimental_invoice_request) =
13201320
match self {
13211321
InvoiceContents::ForOffer { invoice_request, .. } => {
@@ -1379,7 +1379,7 @@ pub(super) fn filter_fallbacks(chain: ChainHash, fallbacks: &Vec<FallbackAddress
13791379
}
13801380

13811381
impl InvoiceFields {
1382-
fn as_tlv_stream(&self) -> (InvoiceTlvStreamRef, ExperimentalInvoiceTlvStreamRef) {
1382+
fn as_tlv_stream(&self) -> (InvoiceTlvStreamRef<'_>, ExperimentalInvoiceTlvStreamRef) {
13831383
let features = {
13841384
if self.features == Bolt12InvoiceFeatures::empty() {
13851385
None

0 commit comments

Comments
 (0)