mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-04 00:54:07 +02:00
use the smallest possible size int for descriminant reading/writing
This commit is contained in:
parent
2a1718b5f6
commit
eb4bafc310
4 changed files with 40 additions and 18 deletions
|
|
@ -3,11 +3,13 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use bitbuffer::{BitReadStream, Endianness};
|
||||
use bitbuffer_derive::{BitWrite, BitWriteSized};
|
||||
use bitbuffer_derive::{BitRead, BitWrite, BitWriteSized};
|
||||
|
||||
#[derive(BitWrite)]
|
||||
struct TestSizeExpression {
|
||||
size: u8,
|
||||
#[size = "size + 2"]
|
||||
str: String,
|
||||
#[discriminant_bits = 4]
|
||||
enum TestEnumRest {
|
||||
Foo,
|
||||
Bar,
|
||||
#[discriminant = "_"]
|
||||
Asd,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue