From: Jeffrey Czyz Date: Wed, 6 Nov 2024 17:11:11 +0000 (-0600) Subject: Add Description::empty constructor X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=65790b67189745471e60606c622cd97b7314cedc;p=rust-lightning Add Description::empty constructor When creating a default Bolt11InvoiceParameters, having an infallible constructor avoids an unwrap. --- diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 9f049deb7..6f7ec2253 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -1600,6 +1600,11 @@ impl Description { } } + /// Creates an empty `Description`. + pub fn empty() -> Self { + Description(UntrustedString(String::new())) + } + /// Returns the underlying description [`UntrustedString`] pub fn into_inner(self) -> UntrustedString { self.0