Skip to content

Version 0.15.0

Latest

Choose a tag to compare

@csnover csnover released this 05 May 21:44
· 16 commits to master since this release
v0.15.0
841f2bd

Breaking changes

  • The generic parameter lists for binrw::helpers functions have been reordered to put most-frequently-used parameters first.
  • Lifetime parameters have been added to several binrw::helpers functions to support borrowed arguments.
  • The MSRV has been increased to 1.70.
  • Parsing a unit enum with magic will now return an Io(UnexpectedEof) error when all attempts to read magic result in an UnexpectedEof. Previously, this would return NoVariantMatch. (#324, #325. Thanks, @plaflamme!)

Enhancements

  • PosValue now includes implementations for Default and BinWrite. The BinWrite implementation simply treats PosValue as a wrapper and writes the stored value in place; the pos field is ignored. Use the seek_before and (optionally) restore_position directives if you want to write a PosValue value 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_ne and BinWrite::write_ne_args convenience functions have been added to match the same functions in the BinRead API.
  • The owo-colors dependency has been updated to version 4.

Bug fixes

  • Using SeekFrom::End with TakeSeek now correctly seeks relative to the end of the stream if the stream is shorter than the limit. (#291)
  • Using binrw::helpers::count_with to return a Vec<{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::helpers functions.
  • The args directive can now be used when closures are passed to parse_with or write_with.
  • All forwarding calls in the BinReadExt and BinWriteExt traits are now appropriately annotated with #[inline].