format_struct::format_struct! {
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub struct dynamic Foo {
pub bar: u32,
}
}
#[test]
fn integration() {
assert_eq!(
Foo::from_bytes([11, 0, 0, 0])
.bar
.get_with_endian(format_struct::Endian::Little),
11
);
assert_eq!(
Foo::from_bytes([11, 0, 0, 0])
.bar
.get_with_endian(format_struct::Endian::Big),
11 << 24
);
}