Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,16 @@ impl<H: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Bool>
Bolt11InvoiceDescription::Hash(hash) => self.description_hash(hash.0),
}
}

/// Set the description or description hash. This function is only available if no description (hash) was set.
pub fn invoice_description_ref(
self, description_ref: Bolt11InvoiceDescriptionRef<'_>,
) -> InvoiceBuilder<tb::True, H, T, C, S, M> {
match description_ref {
Bolt11InvoiceDescriptionRef::Direct(desc) => self.description(desc.clone().0 .0),
Bolt11InvoiceDescriptionRef::Hash(hash) => self.description_hash(hash.0),
}
}
}

impl<D: tb::Bool, T: tb::Bool, C: tb::Bool, S: tb::Bool, M: tb::Bool>
Expand Down
Loading