Skip to content

Commit 9ca0fea

Browse files
committed
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.
1 parent 4107823 commit 9ca0fea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning/src/onion_message/packet.rs

+3
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,16 @@ pub enum OnionMessageContents<T: CustomOnionMessageContents> {
118118

119119
impl<T: CustomOnionMessageContents> OnionMessageContents<T> {
120120
/// Returns the type that was used to decode the message payload.
121+
///
122+
/// (C-not exported) as methods on non-cloneable enums are not currently exportable
121123
pub fn tlv_type(&self) -> u64 {
122124
match self {
123125
&OnionMessageContents::Custom(ref msg) => msg.tlv_type(),
124126
}
125127
}
126128
}
127129

130+
/// (C-not exported) as methods on non-cloneable enums are not currently exportable
128131
impl<T: CustomOnionMessageContents> Writeable for OnionMessageContents<T> {
129132
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
130133
match self {

0 commit comments

Comments
 (0)