Expose description from Invoice's offer/refund
[rust-lightning] / lightning / src / offers / refund.rs
index f677a2a9cdb61fcdf5f5fe9f5389a6dba895512c..eac7a3754edf54444d3b87b6c3b31fd5ccf4f3dd 100644 (file)
@@ -310,7 +310,7 @@ impl Refund {
        /// A complete description of the purpose of the refund. 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()
        }
 
        /// Duration since the Unix epoch when an invoice should no longer be sent.
@@ -489,6 +489,10 @@ impl AsRef<[u8]> for Refund {
 }
 
 impl RefundContents {
+       pub fn description(&self) -> PrintableString {
+               PrintableString(&self.description)
+       }
+
        #[cfg(feature = "std")]
        pub(super) fn is_expired(&self) -> bool {
                match self.absolute_expiry {