serde icon indicating copy to clipboard operation
serde copied to clipboard

Remove code duplication when deriving Deserialize for adjacently tagged enums

Open Mingun opened this issue 6 months ago • 1 comments

Adjacently tagged enums with many struct variants should get most benefit from that.

Mingun avatar May 29 '25 17:05 Mingun

@dtolnay, @oli-obk, could you look at this simple optimization?

Mingun avatar Jun 07 '25 05:06 Mingun

@dtolnay, @oli-obk mind to merge this very simple optimization (the second commit does the job). Expanding of variant_arms variable performed twice which creates duplication. The effect especially visible when struct variants are used, because they generate a lot of code.

Mingun avatar Sep 18 '25 16:09 Mingun