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

Improve debug information for `NoVariantMatch` from the `repr` attribute #117

Closed jam1garner closed 2 years ago

jam1garner commented 2 years ago

For unit enums using brw(repr), no information is given about what was actually parsed when no matching variant is present.

Proposed Fix

Have the constructed error be a Backtrace, provide information about what was actually present as an additional layer of context.