jam1garner / jam1garner/binrw

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

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
853
Forks
56
PR merge metrics
No merged PRs in 30d

Description

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

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`
* Breaking some existing use-case maybe?

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementation of the count attribute and the binrw::helpers::count helper. Compare how Vec, other FromIterator types, and the Vec path are handled. Done means the attribute desugars through the helper, broader collection types work, and existing behavior and performance-sensitive cases are covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.