Merge pull request #2206 from jkczyz/2023-04-invoice-description
[rust-lightning] / lightning / src / offers / offer.rs
index d2918e809429d8f5db858b52930e8e19634e869e..192317240f94df2e61ffbe7269f97cd3d4d22701 100644 (file)
@@ -384,7 +384,7 @@ impl Offer {
        /// A complete description of the purpose of the payment. Intended to be displayed to the user
        /// but with the caveat that it has not been verified in any way.
        pub fn description(&self) -> PrintableString {
-               PrintableString(&self.contents.description)
+               self.contents.description()
        }
 
        /// Features pertaining to the offer.
@@ -536,6 +536,10 @@ impl OfferContents {
                self.metadata.as_ref().and_then(|metadata| metadata.as_bytes())
        }
 
+       pub fn description(&self) -> PrintableString {
+               PrintableString(&self.description)
+       }
+
        #[cfg(feature = "std")]
        pub(super) fn is_expired(&self) -> bool {
                match self.absolute_expiry {