File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -292,12 +292,19 @@ macro_rules! _decode_tlv {
292
292
( $reader: expr, $field: ident, option) => { {
293
293
$field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
294
294
} } ;
295
+ // `upgradable_required` indicates we're reading a required TLV that may have been upgraded
296
+ // without backwards compat. We'll error if the field is missing, and return `Ok(None)` if the
297
+ // field is present but we can no longer understand it.
298
+ // Note that this variant can only be used within a `MaybeReadable` read.
295
299
( $reader: expr, $field: ident, upgradable_required) => { {
296
300
$field = match $crate:: util:: ser:: MaybeReadable :: read( & mut $reader) ? {
297
301
Some ( res) => res,
298
302
_ => return Ok ( None )
299
303
} ;
300
304
} } ;
305
+ // `upgradable_option` indicates we're reading an Option-al TLV that may have been upgraded
306
+ // without backwards compat. $field will be None if the TLV is missing or if the field is present
307
+ // but we can no longer understand it.
301
308
( $reader: expr, $field: ident, upgradable_option) => { {
302
309
$field = $crate:: util:: ser:: MaybeReadable :: read( & mut $reader) ?;
303
310
} } ;
You can’t perform that action at this time.
0 commit comments