1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

fix size expressions

This commit is contained in:
Robin Appelman 2021-07-13 19:10:09 +02:00
commit b7fa549e79
3 changed files with 58 additions and 22 deletions

View file

@ -6,10 +6,8 @@ use bitbuffer::{BitReadStream, Endianness};
use bitbuffer_derive::{BitWrite, BitWriteSized};
#[derive(BitWrite)]
struct TestStruct {
foo: u8,
struct TestSizeExpression {
size: u8,
#[size = "size + 2"]
str: String,
}
#[derive(BitWrite)]
struct UnnamedSize(u8, #[size = 5] String, bool);