Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jam1garner opened this issue Sep 12, 2021 · 1 comment
Open

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

jam1garner opened this issue Sep 12, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jam1garner
Copy link
Owner

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

Upsides:

  • Less magic implementation, more type safe
  • Adds support for more types

Possible pitfalls:

  • Perf regression due to the lack of "fake specialization" provided for Vec<u8>
  • Breaking some existing use-case maybe?
@roblabla
Copy link
Collaborator

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.

@csnover csnover self-assigned this Aug 29, 2022
@csnover csnover removed their assignment Nov 15, 2022
@csnover csnover added the enhancement New feature or request label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants