hashmismatch / packed_struct.rs

Bit-level packing and unpacking for Rust
MIT License
163 stars 30 forks source link

Missing packed_bytes() method #81

Closed luciusmagn closed 3 years ago

luciusmagn commented 3 years ago

Hi, I've noticed the packed_bytes() method was removed. Would it be possible to add it again, if not, I am curious, why it was removed?

rudib commented 3 years ago

It has been replaced with packed_bytes_size(opt_self: Option<&Self>), which also supports dynamically sized structures - where the contents of the structure can influence the packed size.

https://github.com/hashmismatch/packed_struct.rs/commit/97ec#diff-e758493f4607bcfe4067845c4168cfb16c7725fa1d4742ee8ddad191416912faL29-R30