Skip to content

Commit 4bab16e

Browse files
committed
Fix some macro docs
I wrote these comments before while misunderstanding what these macros do. Updated them.
1 parent 402aeb4 commit 4bab16e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lightning/src/util/ser_macros.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ macro_rules! encode_varint_length_prefixed_tlv {
102102
} }
103103
}
104104

105-
/// Asserts that the type of the last seen TLV is strictly less than the type of the TLV currently being processed.
105+
/// Errors if there are missing required TLV types between the last seen type and the type currently being processed.
106106
#[macro_export]
107107
macro_rules! check_tlv_order {
108108
($last_seen_type: expr, $typ: expr, $type: expr, $field: ident, (default_value, $default: expr)) => {{
@@ -130,8 +130,7 @@ macro_rules! check_tlv_order {
130130
}};
131131
}
132132

133-
/// Checks for required missing TLV records. If a required TLV is missing and has no default value,
134-
/// an error is returned.
133+
/// Errors if there are missing required TLV types after the last seen type.
135134
#[macro_export]
136135
macro_rules! check_missing_tlv {
137136
($last_seen_type: expr, $type: expr, $field: ident, (default_value, $default: expr)) => {{
@@ -217,7 +216,7 @@ macro_rules! decode_tlv_stream {
217216
},
218217
_ => {},
219218
}
220-
// As we read types, make sure we hit every required type:
219+
// As we read types, make sure we hit every required type between last_seen_type and typ:
221220
$({
222221
check_tlv_order!(last_seen_type, typ, $type, $field, $fieldty);
223222
})*

0 commit comments

Comments
 (0)