From f00bc4d71399ca57caea6827dfdbd8e45d1483df Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 23 Dec 2022 20:44:24 +0000 Subject: [PATCH] No-export `&self` methods on non-cloneable enum(s) Specifically, `OnionMessageContents` is a non-cloneable enum, which isn't stored opaque so we cannot call `&self` methods on it. Because its methods aren't critical to the API for now, we simply no-export them rather than trying to work out an alternative approach. --- lightning/src/onion_message/packet.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightning/src/onion_message/packet.rs b/lightning/src/onion_message/packet.rs index 3222c08a3..5ff226387 100644 --- a/lightning/src/onion_message/packet.rs +++ b/lightning/src/onion_message/packet.rs @@ -118,6 +118,8 @@ pub enum OnionMessageContents { impl OnionMessageContents { /// Returns the type that was used to decode the message payload. + /// + /// (C-not exported) as methods on non-cloneable enums are not currently exportable pub fn tlv_type(&self) -> u64 { match self { &OnionMessageContents::Custom(ref msg) => msg.tlv_type(), @@ -125,6 +127,7 @@ impl OnionMessageContents { } } +/// (C-not exported) as methods on non-cloneable enums are not currently exportable impl Writeable for OnionMessageContents { fn write(&self, w: &mut W) -> Result<(), io::Error> { match self { -- 2.39.5