-
- let mut payment_hash = PaymentHash([0; 32]);
- payment_hash.0.copy_from_slice(&invoice.payment_hash().as_ref()[0..32]);
-
- let payment_secret = match invoice.payment_secret() {
- Some(secret) => {
- let mut payment_secret = PaymentSecret([0; 32]);
- payment_secret.0.copy_from_slice(&secret.0);
- Some(payment_secret)
- }
- None => None,
- };
-
- let invoice_features = match invoice.features() {
- Some(feat) => Some(feat.clone()),
- None => None,
- };
+ let payment_hash = PaymentHash(invoice.payment_hash().clone().into_inner());
+ let payment_secret = invoice.payment_secret().cloned();
+ let invoice_features = invoice.features().cloned();