New
Version 0.15.0
Breaking changes
- The generic parameter lists for
binrw::helpersfunctions have been reordered to put most-frequently-used parameters first. - Lifetime parameters have been added to several
binrw::helpersfunctions to support borrowed arguments. - The MSRV has been increased to 1.70.
- Parsing a unit enum with
magicwill now return anIo(UnexpectedEof)error when all attempts to read magic result in anUnexpectedEof. Previously, this would returnNoVariantMatch. (#324, #325. Thanks, @plaflamme!)
Enhancements
PosValuenow includes implementations forDefaultandBinWrite. TheBinWriteimplementation simply treatsPosValueas a wrapper and writes the stored value in place; theposfield is ignored. Use theseek_beforeand (optionally)restore_positiondirectives if you want to write aPosValuevalue to a different position in the output stream. (#270, #273. Thanks, @amirbou!)- binrw now uses syn 2 internally, which should reduce the build time for most users of binrw when used with other dependencies that have also updated to syn 2. (#285, #299. Thanks, @Urist-McGit!)
- The amount of code generated has been reduced, improving compilation times. (#319. Thanks, @ScanMountGoat!)
- Various small documentation improvements. (Thanks, @marxin!)
BinWrite::write_neandBinWrite::write_ne_argsconvenience functions have been added to match the same functions in theBinReadAPI.- The owo-colors dependency has been updated to version 4.
Bug fixes
- Using
SeekFrom::EndwithTakeSeeknow correctly seeks relative to the end of the stream if the stream is shorter than the limit. (#291) - Using
binrw::helpers::count_withto return aVec<{integer}>using a custom function will no longer ignore the custom function. (#318. Thanks, @kitlith!) - It is now possible to pass borrowed values when using
binrw::helpersfunctions. - The
argsdirective can now be used when closures are passed toparse_withorwrite_with. - All forwarding calls in the
BinReadExtandBinWriteExttraits are now appropriately annotated with#[inline].