Skip to content

Commit

Permalink
Upgrade to bitvec 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Oct 8, 2022
1 parent deac06d commit 129a07a
Show file tree
Hide file tree
Showing 23 changed files with 284 additions and 282 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const_generics = []

[dependencies]
deku_derive = { version = "^0.14.0", path = "deku-derive", default-features = false}
bitvec = { version = "0.22.1", default-features = false }
bitvec = { version = "1.0.0", default-features = false }
log = { version = "0.4.17", optional = true }

[dev-dependencies]
Expand Down
14 changes: 7 additions & 7 deletions deku-derive/src/macros/deku_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {
let __deku_pad = 8 * ((__deku_rest.len() + 7) / 8) - __deku_rest.len();
let __deku_read_idx = __deku_input_bits.len() - (__deku_rest.len() + __deku_pad);

Ok(((__deku_input_bits[__deku_read_idx..].as_raw_slice(), __deku_pad), __deku_value))
Ok(((__deku_input_bits[__deku_read_idx..].domain().region().unwrap().1, __deku_pad), __deku_value))
},
&input.ctx,
&input.ctx_default,
Expand Down Expand Up @@ -110,7 +110,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {

tokens.extend(quote! {
impl #imp ::#crate_::DekuRead<#lifetime, #ctx_types> for #ident #wher {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, #ctx_arg) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, Self), ::#crate_::DekuError> {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, #ctx_arg) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, Self), ::#crate_::DekuError> {
#read_body
}
}
Expand All @@ -121,7 +121,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {

tokens.extend(quote! {
impl #imp ::#crate_::DekuRead<#lifetime> for #ident #wher {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, _: ()) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, Self), ::#crate_::DekuError> {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, _: ()) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, Self), ::#crate_::DekuError> {
#read_body
}
}
Expand Down Expand Up @@ -308,7 +308,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
let __deku_pad = 8 * ((__deku_rest.len() + 7) / 8) - __deku_rest.len();
let __deku_read_idx = __deku_input_bits.len() - (__deku_rest.len() + __deku_pad);

Ok(((__deku_input_bits[__deku_read_idx..].as_raw_slice(), __deku_pad), __deku_value))
Ok(((__deku_input_bits[__deku_read_idx..].domain().region().unwrap().1, __deku_pad), __deku_value))
},
&input.ctx,
&input.ctx_default,
Expand Down Expand Up @@ -340,7 +340,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
tokens.extend(quote! {
#[allow(non_snake_case)]
impl #imp ::#crate_::DekuRead<#lifetime, #ctx_types> for #ident #wher {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, #ctx_arg) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, Self), ::#crate_::DekuError> {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, #ctx_arg) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, Self), ::#crate_::DekuError> {
#read_body
}
}
Expand All @@ -352,7 +352,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
tokens.extend(quote! {
#[allow(non_snake_case)]
impl #imp ::#crate_::DekuRead<#lifetime> for #ident #wher {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, _: ()) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<::#crate_::bitvec::Msb0, u8>, Self), ::#crate_::DekuError> {
fn read(__deku_input_bits: &#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, _: ()) -> Result<(&#lifetime ::#crate_::bitvec::BitSlice<u8, ::#crate_::bitvec::Msb0>, Self), ::#crate_::DekuError> {
#read_body
}
}
Expand Down Expand Up @@ -453,7 +453,7 @@ fn emit_bit_byte_offsets(
|| byte_offset.is_some()
{
Some(quote! {
let __deku_bit_offset = usize::try_from(__deku_input_bits.offset_from(__deku_rest))?;
let __deku_bit_offset = usize::try_from(unsafe { __deku_rest.as_bitptr().offset_from(__deku_input_bits.as_bitptr()) } )?;
})
} else {
None
Expand Down
24 changes: 12 additions & 12 deletions deku-derive/src/macros/deku_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {
quote! {
match *self {
#destructured => {
let mut __deku_acc: ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> = ::#crate_::bitvec::BitVec::new();
let mut __deku_acc: ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> = ::#crate_::bitvec::BitVec::new();
let __deku_output = &mut __deku_acc;

#magic_write
Expand All @@ -62,7 +62,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {
);

tokens.extend(quote! {
impl #imp core::convert::TryFrom<#ident> for ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> #wher {
impl #imp core::convert::TryFrom<#ident> for ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> #wher {
type Error = ::#crate_::DekuError;

fn try_from(input: #ident) -> Result<Self, Self::Error> {
Expand All @@ -80,12 +80,12 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {

impl #imp DekuContainerWrite for #ident #wher {
fn to_bytes(&self) -> Result<Vec<u8>, ::#crate_::DekuError> {
let mut acc: ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> = self.to_bits()?;
let mut acc: ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> = self.to_bits()?;
Ok(acc.into_vec())
}

#[allow(unused_variables)]
fn to_bits(&self) -> Result<::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, ::#crate_::DekuError> {
fn to_bits(&self) -> Result<::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, ::#crate_::DekuError> {
#to_bits_body
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {

impl #imp DekuWrite<#ctx_types> for #ident #wher {
#[allow(unused_variables)]
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, #ctx_arg) -> Result<(), ::#crate_::DekuError> {
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, #ctx_arg) -> Result<(), ::#crate_::DekuError> {
#write_body
}
}
Expand All @@ -132,7 +132,7 @@ fn emit_struct(input: &DekuData) -> Result<TokenStream, syn::Error> {
tokens.extend(quote! {
impl #imp DekuWrite for #ident #wher {
#[allow(unused_variables)]
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, _: ()) -> Result<(), ::#crate_::DekuError> {
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, _: ()) -> Result<(), ::#crate_::DekuError> {
#write_body
}
}
Expand Down Expand Up @@ -258,7 +258,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
if input.ctx.is_none() || (input.ctx.is_some() && input.ctx_default.is_some()) {
let to_bits_body = wrap_default_ctx(
quote! {
let mut __deku_acc: ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> = ::#crate_::bitvec::BitVec::new();
let mut __deku_acc: ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> = ::#crate_::bitvec::BitVec::new();
let __deku_output = &mut __deku_acc;

#magic_write
Expand All @@ -274,7 +274,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
);

tokens.extend(quote! {
impl #imp core::convert::TryFrom<#ident> for ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> #wher {
impl #imp core::convert::TryFrom<#ident> for ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> #wher {
type Error = ::#crate_::DekuError;

fn try_from(input: #ident) -> Result<Self, Self::Error> {
Expand All @@ -292,12 +292,12 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {

impl #imp DekuContainerWrite for #ident #wher {
fn to_bytes(&self) -> Result<Vec<u8>, ::#crate_::DekuError> {
let mut acc: ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8> = self.to_bits()?;
let mut acc: ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0> = self.to_bits()?;
Ok(acc.into_vec())
}

#[allow(unused_variables)]
fn to_bits(&self) -> Result<::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, ::#crate_::DekuError> {
fn to_bits(&self) -> Result<::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, ::#crate_::DekuError> {
#to_bits_body
}
}
Expand Down Expand Up @@ -334,7 +334,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {

impl #imp DekuWrite<#ctx_types> for #ident #wher {
#[allow(unused_variables)]
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, #ctx_arg) -> Result<(), ::#crate_::DekuError> {
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, #ctx_arg) -> Result<(), ::#crate_::DekuError> {
#write_body
}
}
Expand All @@ -346,7 +346,7 @@ fn emit_enum(input: &DekuData) -> Result<TokenStream, syn::Error> {
tokens.extend(quote! {
impl #imp DekuWrite for #ident #wher {
#[allow(unused_variables)]
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<::#crate_::bitvec::Msb0, u8>, _: ()) -> Result<(), ::#crate_::DekuError> {
fn write(&self, __deku_output: &mut ::#crate_::bitvec::BitVec<u8, ::#crate_::bitvec::Msb0>, _: ()) -> Result<(), ::#crate_::DekuError> {
#write_body
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_reader_and_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::convert::TryInto;

fn bit_flipper_read(
field_a: u8,
rest: &BitSlice<Msb0, u8>,
rest: &BitSlice<u8, Msb0>,
bit_size: BitSize,
) -> Result<(&BitSlice<Msb0, u8>, u8), DekuError> {
) -> Result<(&BitSlice<u8, Msb0>, u8), DekuError> {
// Access to previously read fields
println!("field_a = 0x{:X}", field_a);

Expand All @@ -29,7 +29,7 @@ fn bit_flipper_read(
fn bit_flipper_write(
field_a: u8,
field_b: u8,
output: &mut BitVec<Msb0, u8>,
output: &mut BitVec<u8, Msb0>,
bit_size: BitSize,
) -> Result<(), DekuError> {
// Access to previously written fields
Expand Down
6 changes: 3 additions & 3 deletions src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,14 +776,14 @@ struct DekuTest {
impl DekuTest {
/// Read and convert to String
fn read(
rest: &BitSlice<Msb0, u8>,
) -> Result<(&BitSlice<Msb0, u8>, String), DekuError> {
rest: &BitSlice<u8, Msb0>,
) -> Result<(&BitSlice<u8, Msb0>, String), DekuError> {
let (rest, value) = u8::read(rest, ())?;
Ok((rest, value.to_string()))
}
/// Parse from String to u8 and write
fn write(output: &mut BitVec<Msb0, u8>, field_a: &str) -> Result<(), DekuError> {
fn write(output: &mut BitVec<u8, Msb0>, field_a: &str) -> Result<(), DekuError> {
let value = field_a.parse::<u8>().unwrap();
value.write(output, ())
}
Expand Down
10 changes: 5 additions & 5 deletions src/impls/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ where
/// wrapper around u8::read with consideration to context, such as bit size
/// true if the result of the read is `1`, false if `0` and error otherwise
fn read(
input: &'a BitSlice<Msb0, u8>,
input: &'a BitSlice<u8, Msb0>,
inner_ctx: Ctx,
) -> Result<(&'a BitSlice<Msb0, u8>, Self), DekuError> {
) -> Result<(&'a BitSlice<u8, Msb0>, Self), DekuError> {
let (rest, val) = u8::read(input, inner_ctx)?;

let ret = match val {
Expand All @@ -35,7 +35,7 @@ where
u8: DekuWrite<Ctx>,
{
/// wrapper around u8::write with consideration to context, such as bit size
fn write(&self, output: &mut BitVec<Msb0, u8>, inner_ctx: Ctx) -> Result<(), DekuError> {
fn write(&self, output: &mut BitVec<u8, Msb0>, inner_ctx: Ctx) -> Result<(), DekuError> {
match self {
true => (0x01u8).write(output, inner_ctx),
false => (0x00u8).write(output, inner_ctx),
Expand All @@ -62,7 +62,7 @@ mod tests {
assert_eq!(expected, res_read);
assert!(rest.is_empty());

let mut res_write = bitvec![Msb0, u8;];
let mut res_write = bitvec![u8, Msb0;];
res_read.write(&mut res_write, ()).unwrap();
assert_eq!(input.to_vec(), res_write.into_vec());
}
Expand All @@ -76,7 +76,7 @@ mod tests {
assert_eq!(true, res_read);
assert_eq!(6, rest.len());

let mut res_write = bitvec![Msb0, u8;];
let mut res_write = bitvec![u8, Msb0;];
res_read.write(&mut res_write, ()).unwrap();
assert_eq!(vec![0b01], res_write.into_vec());
}
Expand Down
34 changes: 17 additions & 17 deletions src/impls/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ where
{
/// Read a T from input and store as Box<T>
fn read(
input: &'a BitSlice<Msb0, u8>,
input: &'a BitSlice<u8, Msb0>,
inner_ctx: Ctx,
) -> Result<(&'a BitSlice<Msb0, u8>, Self), DekuError>
) -> Result<(&'a BitSlice<u8, Msb0>, Self), DekuError>
where
Self: Sized,
{
Expand All @@ -26,7 +26,7 @@ where
Ctx: Copy,
{
/// Write T from box
fn write(&self, output: &mut BitVec<Msb0, u8>, inner_ctx: Ctx) -> Result<(), DekuError> {
fn write(&self, output: &mut BitVec<u8, Msb0>, inner_ctx: Ctx) -> Result<(), DekuError> {
self.as_ref().write(output, inner_ctx)
}
}
Expand All @@ -39,9 +39,9 @@ where
{
/// Read `T`s until the given limit
fn read(
input: &'a BitSlice<Msb0, u8>,
input: &'a BitSlice<u8, Msb0>,
(limit, inner_ctx): (Limit<T, Predicate>, Ctx),
) -> Result<(&'a BitSlice<Msb0, u8>, Self), DekuError>
) -> Result<(&'a BitSlice<u8, Msb0>, Self), DekuError>
where
Self: Sized,
{
Expand All @@ -57,7 +57,7 @@ where
Ctx: Copy,
{
/// Write all `T`s to bits
fn write(&self, output: &mut BitVec<Msb0, u8>, ctx: Ctx) -> Result<(), DekuError> {
fn write(&self, output: &mut BitVec<u8, Msb0>, ctx: Ctx) -> Result<(), DekuError> {
for v in self.as_ref() {
v.write(output, ctx)?;
}
Expand All @@ -76,36 +76,36 @@ mod tests {
case(
&[0xEF, 0xBE],
Box::new(native_endian!(0xBEEF_u16)),
bits![Msb0, u8;]
bits![u8, Msb0;]
),
)]
fn test_boxed(input: &[u8], expected: Box<u16>, expected_rest: &BitSlice<Msb0, u8>) {
fn test_boxed(input: &[u8], expected: Box<u16>, expected_rest: &BitSlice<u8, Msb0>) {
let bit_slice = input.view_bits::<Msb0>();
let (rest, res_read) = <Box<u16>>::read(bit_slice, ()).unwrap();
assert_eq!(expected, res_read);
assert_eq!(expected_rest, rest);

let mut res_write = bitvec![Msb0, u8;];
let mut res_write = bitvec![u8, Msb0;];
res_read.write(&mut res_write, ()).unwrap();
assert_eq!(input.to_vec(), res_write.into_vec());
}

// Note: Copied tests from vec.rs impl
#[rstest(input, endian, bit_size, limit, expected, expected_rest, expected_write,
case::normal_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), 2.into(), vec![0xBBAA, 0xDDCC].into_boxed_slice(), bits![Msb0, u8;], vec![0xAA, 0xBB, 0xCC, 0xDD]),
case::normal_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), 2.into(), vec![0xAABB, 0xCCDD].into_boxed_slice(), bits![Msb0, u8;], vec![0xAA, 0xBB, 0xCC, 0xDD]),
case::predicate_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), (|v: &u16| *v == 0xBBAA).into(), vec![0xBBAA].into_boxed_slice(), bits![Msb0, u8; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::predicate_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), (|v: &u16| *v == 0xAABB).into(), vec![0xAABB].into_boxed_slice(), bits![Msb0, u8; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::bytes_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), BitSize(16).into(), vec![0xBBAA].into_boxed_slice(), bits![Msb0, u8; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::bytes_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), BitSize(16).into(), vec![0xAABB].into_boxed_slice(), bits![Msb0, u8; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::normal_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), 2.into(), vec![0xBBAA, 0xDDCC].into_boxed_slice(), bits![u8, Msb0;], vec![0xAA, 0xBB, 0xCC, 0xDD]),
case::normal_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), 2.into(), vec![0xAABB, 0xCCDD].into_boxed_slice(), bits![u8, Msb0;], vec![0xAA, 0xBB, 0xCC, 0xDD]),
case::predicate_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), (|v: &u16| *v == 0xBBAA).into(), vec![0xBBAA].into_boxed_slice(), bits![u8, Msb0; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::predicate_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), (|v: &u16| *v == 0xAABB).into(), vec![0xAABB].into_boxed_slice(), bits![u8, Msb0; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::bytes_le([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Little, Some(16), BitSize(16).into(), vec![0xBBAA].into_boxed_slice(), bits![u8, Msb0; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
case::bytes_be([0xAA, 0xBB, 0xCC, 0xDD].as_ref(), Endian::Big, Some(16), BitSize(16).into(), vec![0xAABB].into_boxed_slice(), bits![u8, Msb0; 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1], vec![0xAA, 0xBB]),
)]
fn test_boxed_slice<Predicate: FnMut(&u16) -> bool>(
input: &[u8],
endian: Endian,
bit_size: Option<usize>,
limit: Limit<u16, Predicate>,
expected: Box<[u16]>,
expected_rest: &BitSlice<Msb0, u8>,
expected_rest: &BitSlice<u8, Msb0>,
expected_write: Vec<u8>,
) {
let bit_slice = input.view_bits::<Msb0>();
Expand All @@ -118,7 +118,7 @@ mod tests {
assert_eq!(expected, res_read);
assert_eq!(expected_rest, rest);

let mut res_write = bitvec![Msb0, u8;];
let mut res_write = bitvec![u8, Msb0;];
res_read
.write(&mut res_write, (endian, BitSize(bit_size)))
.unwrap();
Expand Down
Loading

0 comments on commit 129a07a

Please sign in to comment.