From: Matt Corallo Date: Fri, 23 Dec 2022 20:44:24 +0000 (+0000) Subject: No-export `&self` methods on non-cloneable enum(s) X-Git-Tag: v0.0.114-beta~75^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2022-12-113-bindings-upstream;p=rust-lightning 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. --- 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 {