jam1garner / binrw

A Rust crate for helping parse and rebuild binary data using ✨macro magic✨.
https://binrw.rs
MIT License
585 stars 35 forks source link

Move br(count) attribute to desugar to binrw::helpers::count #52

Open jam1garner opened 3 years ago

jam1garner commented 3 years ago

Unlike the count attribute, which is limited to supporting Vec<T>, the count helper function works for any type which implements FromIterator<T>.

Upsides:

Possible pitfalls:

roblabla commented 3 years ago

FWIW, if there's a measurable perf regression, this sounds exactly like the kind of use-cases where autoref specialization could be used to recover the lost perf.