derive(Format): Support more than 256 variants#302
derive(Format): Support more than 256 variants#302bors[bot] merged 1 commit intoknurling-rs:mainfrom
Conversation
japaric
left a comment
There was a problem hiding this comment.
The encoder part looks good but I think we also need to do changes in the decoder.
Could you add the EnumLarge as a test to firmware/log.rs and test out a small enum and a large (>256) enum?
| } | ||
|
|
||
| defmt::info!("Format EnumLarge Variant: {:?}", EnumLarge::A007); | ||
| defmt::info!("Format EnumLarge Variant: {:?}", EnumLarge::A269); |
There was a problem hiding this comment.
this fails locally with
0.000101 INFO Format EnumLarge Variant: A007
failed to decode defmt data: [0, 99, 1]
Error: malformed dataI think the decoder expects that the discriminant is encoded as a single byte but with these changes it should consider how many the variants the enum has (and use 1,2,3,4,etc. bytes as the discriminant size)
There was a problem hiding this comment.
Whoops interesting. It's failing locally for me as well. I just pushed it to have a failing case to move along and eventually make it pass.
But that this does not fail in CI is interesting.
There was a problem hiding this comment.
I think CI is not running because the PR has merge conflicts. The last CI run (I'm referring to the GitHub Action runs on this repo; if you are referring to the ones on you fork, I've not seen those) is from your very first version, which didn't have the qemu test.
ff704da to
2bacbd9
Compare
|
Nice! Thanks for the PR. bors r+ |
|
Build failed: |
|
Thanks! (and sorry for the repeated rebase work) bors r+ |
|
No problem, these were minor anyways. :) |
|
Build succeeded: |
Closes #63