@@ -43,7 +43,7 @@ pub(crate) struct OfferContents {
43
43
metadata : Option < Vec < u8 > > ,
44
44
amount : Option < Amount > ,
45
45
description : String ,
46
- features : Option < OfferFeatures > ,
46
+ features : OfferFeatures ,
47
47
absolute_expiry : Option < Duration > ,
48
48
issuer : Option < String > ,
49
49
paths : Option < Vec < BlindedPath > > ,
@@ -73,13 +73,13 @@ impl Offer {
73
73
}
74
74
75
75
/// A complete description of the purpose of the payment.
76
- pub fn description ( & self ) -> & String {
76
+ pub fn description ( & self ) -> & str {
77
77
& self . contents . description
78
78
}
79
79
80
80
/// Features for paying the invoice.
81
- pub fn features ( & self ) -> Option < & OfferFeatures > {
82
- self . contents . features . as_ref ( )
81
+ pub fn features ( & self ) -> & OfferFeatures {
82
+ & self . contents . features
83
83
}
84
84
85
85
/// Duration since the Unix epoch when an invoice should no longer be requested.
@@ -102,13 +102,13 @@ impl Offer {
102
102
}
103
103
104
104
/// The issuer of the offer, possibly beginning with `user@domain` or `domain`.
105
- pub fn issuer ( & self ) -> Option < & String > {
106
- self . contents . issuer . as_ref ( )
105
+ pub fn issuer ( & self ) -> Option < & str > {
106
+ self . contents . issuer . as_ref ( ) . map ( |issuer| issuer . as_str ( ) )
107
107
}
108
108
109
109
/// Paths to the recipient originating from publicly reachable nodes.
110
- pub fn paths ( & self ) -> Option < & Vec < BlindedPath > > {
111
- self . contents . paths . as_ref ( )
110
+ pub fn paths ( & self ) -> & [ BlindedPath ] {
111
+ self . contents . paths . as_ref ( ) . map ( |paths| paths . as_slice ( ) ) . unwrap_or ( & [ ] )
112
112
}
113
113
114
114
/// The minimum quantity of items supported.
0 commit comments