packable 0.11.0

A crate for packing and unpacking binary representations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

mod common;

#[test]
fn packable_option() {
    assert_eq!(
        common::generic_test(&Option::<u64>::None).0.len(),
        core::mem::size_of::<u8>()
    );
    assert_eq!(
        common::generic_test(&Option::<u64>::Some(42)).0.len(),
        core::mem::size_of::<u8>() + core::mem::size_of::<u64>()
    );
}