Skip to content

Commit b10a4e8

Browse files
committed
Drop WebhookNotification::new in favor of explicit construction
`WebhookNotification` already has all fields `pub`, making its `new` constructor somewhat redundant, but also conflicting with the bindings-auto-generated `new` constructor. Thus we just drop it.
1 parent 031a987 commit b10a4e8

File tree

1 file changed

+5
-10
lines changed
  • lightning-liquidity/src/lsps5

1 file changed

+5
-10
lines changed

lightning-liquidity/src/lsps5/msgs.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -541,34 +541,29 @@ pub struct WebhookNotification {
541541
}
542542

543543
impl WebhookNotification {
544-
/// Create a new webhook notification.
545-
pub fn new(method: WebhookNotificationMethod) -> Self {
546-
Self { method }
547-
}
548-
549544
/// Create a webhook_registered notification.
550545
pub fn webhook_registered() -> Self {
551-
Self::new(WebhookNotificationMethod::LSPS5WebhookRegistered)
546+
Self { method: WebhookNotificationMethod::LSPS5WebhookRegistered }
552547
}
553548

554549
/// Create a payment_incoming notification.
555550
pub fn payment_incoming() -> Self {
556-
Self::new(WebhookNotificationMethod::LSPS5PaymentIncoming)
551+
Self { method: WebhookNotificationMethod::LSPS5PaymentIncoming }
557552
}
558553

559554
/// Create an expiry_soon notification.
560555
pub fn expiry_soon(timeout: u32) -> Self {
561-
Self::new(WebhookNotificationMethod::LSPS5ExpirySoon { timeout })
556+
Self { method: WebhookNotificationMethod::LSPS5ExpirySoon { timeout } }
562557
}
563558

564559
/// Create a liquidity_management_request notification.
565560
pub fn liquidity_management_request() -> Self {
566-
Self::new(WebhookNotificationMethod::LSPS5LiquidityManagementRequest)
561+
Self { method: WebhookNotificationMethod::LSPS5LiquidityManagementRequest }
567562
}
568563

569564
/// Create an onion_message_incoming notification.
570565
pub fn onion_message_incoming() -> Self {
571-
Self::new(WebhookNotificationMethod::LSPS5OnionMessageIncoming)
566+
Self { method: WebhookNotificationMethod::LSPS5OnionMessageIncoming }
572567
}
573568
}
574569

0 commit comments

Comments
 (0)