@@ -281,6 +281,9 @@ macro_rules! _check_decoded_tlv_order {
281
281
( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, option) => { {
282
282
// no-op
283
283
} } ;
284
+ ( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, option_unit) => { {
285
+ // no-op
286
+ } } ;
284
287
( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, required_vec) => { {
285
288
$crate:: _check_decoded_tlv_order!( $last_seen_type, $typ, $type, $field, required) ;
286
289
} } ;
@@ -332,6 +335,9 @@ macro_rules! _check_missing_tlv {
332
335
( $last_seen_type: expr, $type: expr, $field: ident, option) => { {
333
336
// no-op
334
337
} } ;
338
+ ( $last_seen_type: expr, $type: expr, $field: ident, option_unit) => { {
339
+ // no-op
340
+ } } ;
335
341
( $last_seen_type: expr, $type: expr, $field: ident, optional_vec) => { {
336
342
// no-op
337
343
} } ;
@@ -372,6 +378,9 @@ macro_rules! _decode_tlv {
372
378
( $outer_reader: expr, $reader: expr, $field: ident, option) => { {
373
379
$field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
374
380
} } ;
381
+ ( $outer_reader: expr, $reader: expr, $field: ident, option_unit) => { {
382
+ $field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
383
+ } } ;
375
384
( $outer_reader: expr, $reader: expr, $field: ident, optional_vec) => { {
376
385
let f: $crate:: util:: ser:: WithoutLength <Vec <_>> = $crate:: util:: ser:: Readable :: read( & mut $reader) ?;
377
386
$field = Some ( f. 0 ) ;
@@ -792,6 +801,9 @@ macro_rules! _init_tlv_field_var {
792
801
( $field: ident, option) => {
793
802
let mut $field = None ;
794
803
} ;
804
+ ( $field: ident, option_unit) => {
805
+ let mut $field: Option <( ) > = None ;
806
+ } ;
795
807
( $field: ident, optional_vec) => {
796
808
let mut $field = Some ( Vec :: new( ) ) ;
797
809
} ;
0 commit comments