Commit 0120c61
committed
ser: support LengthLimitedRead in impl_writeable_tlv_based_enum
When introducing the LengthLimitedRead trait in [1], for some
serialization macros we need some temporary workaround to
avoid that we have the following compilation error
error[E0277]: the trait bound `Bolt12Invoice: Readable` is not satisfied
--> lightning/src/util/ser_macros.rs:1243:35
|
1243 | Ok($st::$tuple_variant_name($crate::util::ser::Readable::read(reader)?))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Readable` is not implemented for `Bolt12Invoice`
|
::: lightning/src/events/mod.rs:2463:1
|
2463 | / impl_writeable_tlv_based_enum_legacy!(PaidInvoice,
2464 | | ;
2465 | | (0, Bolt12Invoice),
2466 | | (2, StaticInvoice)
2467 | | );
| |_- in this macro invocation
|
= help: the following other types implement trait `Readable`:
()
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
AnnouncementSigsState
and 200 others
= note: this error originates in the macro `impl_writeable_tlv_based_enum_legacy` (in Nightly builds, run with -Z macro-backtrace for more info)
This is a temporary workaround to avoid introducing a big refactoring right now.
[1] #3640
Co-Developed-by: @valentinewallace
Suggested-by: @valentinewallace
Signed-off-by: Vincenzo Palazzo <[email protected]>1 parent 87e0514 commit 0120c61
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | | - | |
| 1203 | + | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | 1206 | | |
| |||
0 commit comments