smessmer / binary-layout

The binary-layout library allows type-safe, inplace, zero-copy access to structured binary data. You define a custom data layout and give it a slice of binary data, and it will allow you to read and write the fields defined in the layout from the binary data without having to copy any of the data. It's similar to transmuting to/from a #[repr(packed)] struct, but much safer.
Apache License 2.0
66 stars 9 forks source link

Fixing no-std support by making thiserror optional and added test #28

Closed TKFRvisionOfficial closed 5 months ago

TKFRvisionOfficial commented 5 months ago

ln version 4.0 the thiserror dependency was added to the library. thiserror isn't no-std compatible, and indeed was disabled in the code using the cfg macro. Sadly it wasn't made optional in the cargo.toml which means that is always compiled, even if the std feature of binary-layout has been disabled.

TKFRvisionOfficial commented 5 months ago

The test I added ensures compatibility with no-std by compiling to thumbv6m-none-eabi, an architecture without std support.

smessmer commented 5 months ago

merged. Thank you.