From 4992955ad395b3276f5fe509dd2331218ad4534a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 31 May 2021 23:40:32 +0000 Subject: [PATCH] f --- lightning/src/util/ser_macros.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lightning/src/util/ser_macros.rs b/lightning/src/util/ser_macros.rs index 4b181c433..44bd9ec49 100644 --- a/lightning/src/util/ser_macros.rs +++ b/lightning/src/util/ser_macros.rs @@ -325,26 +325,26 @@ macro_rules! read_tlv_fields { // `Self { ,,vecfield: vecfield }` which is obviously incorrect. Instead, we have to match here to // detect at least one empty field set and skip the potentially-extra comma. macro_rules! _init_tlv_based_struct { - ($($objs: ident)::*, {}, {$($field: ident),*}, {$($vecfield: ident),*}) => { - Ok($($objs)::* { + ($($type: ident)::*, {}, {$($field: ident),*}, {$($vecfield: ident),*}) => { + Ok($($type)::* { $($field),*, $($vecfield: $vecfield.unwrap().0),* }) }; - ($($objs: ident)::*, {$($reqfield: ident),*}, {}, {$($vecfield: ident),*}) => { - Ok($($objs)::* { + ($($type: ident)::*, {$($reqfield: ident),*}, {}, {$($vecfield: ident),*}) => { + Ok($($type)::* { $($reqfield: $reqfield.0.unwrap()),*, $($vecfield: $vecfield.unwrap().0),* }) }; - ($($objs: ident)::*, {$($reqfield: ident),*}, {$($field: ident),*}, {}) => { - Ok($($objs)::* { + ($($type: ident)::*, {$($reqfield: ident),*}, {$($field: ident),*}, {}) => { + Ok($($type)::* { $($reqfield: $reqfield.0.unwrap()),*, $($field),* }) }; - ($($objs: ident)::*, {$($reqfield: ident),*}, {$($field: ident),*}, {$($vecfield: ident),*}) => { - Ok($($objs)::* { + ($($type: ident)::*, {$($reqfield: ident),*}, {$($field: ident),*}, {$($vecfield: ident),*}) => { + Ok($($type)::* { $($reqfield: $reqfield.0.unwrap()),*, $($field),*, $($vecfield: $vecfield.unwrap().0),* -- 2.39.5