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

Fix no_std compatibility #19

Closed Velko closed 2 years ago

Velko commented 2 years ago

Did not build for #[no_std] environment, as it referenced traits from std::. Replaced it with equivalent ones from core::

smessmer commented 2 years ago

Great, thanks. I kicked off CI. Can you also add a change log entry?

codecov-commenter commented 2 years ago

Codecov Report

Merging #19 (9c6f9cc) into master (f49fa85) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #19   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files           7        7           
  Lines         997      997           
=======================================
  Hits          996      996           
  Misses          1        1           
Impacted Files Coverage Δ
src/fields/primitive/slice_access.rs 100.00% <ø> (ø)
src/utils/data.rs 99.33% <ø> (ø)
src/lib.rs 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f49fa85...9c6f9cc. Read the comment docs.

Velko commented 2 years ago

Added a line in ChangeLog.

I think, it might be a good idea to extend CI, to do a no_std build, to prevent std:: namespace from sneaking in where it shouldn't.

smessmer commented 2 years ago

Extending CI sounds like a great idea. I'll merge this PR for now but feel free to open a new PR for that if you want to implement it.

smessmer commented 2 years ago

Merged. Thanks for your contribution :)