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

Single `collect` implementation for `until`-like helper functions #60

Closed MrNbaYoh closed 3 years ago

MrNbaYoh commented 3 years ago

Previously until-like helper functions stored the elements in a Vec first, and then called collect to build the return value. This PR re-implements the functions to make them directly collect the values instead of storing them in a Vec first. Maybe we should add some tests to check that errors are properly returned?