Skip to content

Commit ea84f2a

Browse files
Document _init_and_read_* ser macro requirements
1 parent ebb0676 commit ea84f2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/util/ser_macros.rs

+6
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ macro_rules! _init_tlv_field_var {
791791

792792
/// Equivalent to running [`_init_tlv_field_var`] then [`read_tlv_fields`].
793793
///
794+
/// If any unused values are read, their type MUST be specified or else `rustc` will read them as an
795+
/// `i64`.
796+
///
794797
/// This is exported for use by other exported macros, do not use directly.
795798
#[doc(hidden)]
796799
#[macro_export]
@@ -807,6 +810,9 @@ macro_rules! _init_and_read_len_prefixed_tlv_fields {
807810
}
808811

809812
/// Equivalent to running [`_init_tlv_field_var`] then [`decode_tlv_stream`].
813+
///
814+
/// If any unused values are read, their type MUST be specified or else `rustc` will read them as an
815+
/// `i64`.
810816
macro_rules! _init_and_read_tlv_stream {
811817
($reader: ident, {$(($type: expr, $field: ident, $fieldty: tt)),* $(,)*}) => {
812818
$(

0 commit comments

Comments
 (0)