We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e40e5f commit 2e18505Copy full SHA for 2e18505
lightning-invoice/src/lib.rs
@@ -269,6 +269,21 @@ pub enum Bolt11InvoiceDescription<'f> {
269
Hash(&'f Sha256),
270
}
271
272
+impl<'f> Default for Bolt11InvoiceDescription<'f> {
273
+ fn default() -> Self {
274
+ Bolt11InvoiceDescription::Direct(&Description::default())
275
+ }
276
+}
277
+
278
+impl<'f> Display for Bolt11InvoiceDescription<'f> {
279
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
280
+ match self {
281
+ Bolt11InvoiceDescription::Direct(desc) => write!(f, "{}", desc),
282
+ Bolt11InvoiceDescription::Hash(hash) => write!(f, "{}", hash.0),
283
284
285
286
287
/// Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
288
/// invalid.
289
///
0 commit comments