Skip to content

Commit 8f00613

Browse files
committed
f - remove Option from some Offer method return values
1 parent bd85560 commit 8f00613

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lightning/src/offers/offer.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,10 @@ impl TryFrom<OfferTlvStream> for SendInvoiceOfferContents {
669669
Some(description) => description,
670670
};
671671

672-
if features.is_some() {
673-
return Err(SemanticError::UnexpectedFeatures);
674-
}
672+
let features = match features {
673+
None => OfferFeatures::empty(),
674+
Some(_) => return Err(SemanticError::UnexpectedFeatures),
675+
};
675676

676677
let absolute_expiry = absolute_expiry.map(Duration::from_secs);
677678

@@ -685,8 +686,8 @@ impl TryFrom<OfferTlvStream> for SendInvoiceOfferContents {
685686
}
686687

687688
Ok(SendInvoiceOfferContents(OfferContents {
688-
chains: None, metadata, amount: None, description, features: None, absolute_expiry,
689-
issuer, paths, quantity_min: None, quantity_max: None, signing_pubkey: None,
689+
chains: None, metadata, amount: None, description, features, absolute_expiry, issuer,
690+
paths, quantity_min: None, quantity_max: None, signing_pubkey: None,
690691
}))
691692
}
692693
}

0 commit comments

Comments
 (0)