Skip to content

Commit 65790b6

Browse files
committed
Add Description::empty constructor
When creating a default Bolt11InvoiceParameters, having an infallible constructor avoids an unwrap.
1 parent 0e1723d commit 65790b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning-invoice/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,11 @@ impl Description {
16001600
}
16011601
}
16021602

1603+
/// Creates an empty `Description`.
1604+
pub fn empty() -> Self {
1605+
Description(UntrustedString(String::new()))
1606+
}
1607+
16031608
/// Returns the underlying description [`UntrustedString`]
16041609
pub fn into_inner(self) -> UntrustedString {
16051610
self.0

0 commit comments

Comments
 (0)