packed_struct.rs icon indicating copy to clipboard operation
packed_struct.rs copied to clipboard

Can we use loops in generated code for arrays?

Open geovex opened this issue 2 years ago • 0 comments

If someone use something like

#[derive(PackedStruct)]
#[packed_struct(endian = "lsb")]
pub struct Record {
    data: [u8; 5000],
    csum: u16,
}

Macro will explode with code for data_0, data_1..... data_5000. Compile times become inadequately big, and lsp will hang. Can we mitigate this somehow?

geovex avatar Jun 01 '23 15:06 geovex