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

NonZeroXXX integers #134

Closed r4v3n6101 closed 2 years ago

r4v3n6101 commented 2 years ago

Hi there! Thanks for your job, it's awesome one! Between this and then I was thinking about non-zero FilePtr's as frequently used: zero describes nothing, otherwise go by location. But there're no such variants of implementations. So, I made my one. Also, it's usable for solving #132.

P. S. FilePtr for now is able to use #[br(try)] resulting in Option<NonZeroFilePtrXX<T>> when offset is zero

r4v3n6101 commented 2 years ago

My bad, format that with CLion, not cargo fmt. Fixed for now though

jam1garner commented 2 years ago

Thanks a ton @r4v3n6101!