a Box<T>
with T
stored inline for values less than a pointer in size.
rs
let small = Miny::new(1u8);
let large = Miny::new([1usize; 32]);
// small is stored inline on the stack
assert!(small.on_stack());
// large is stored with an allocation
assert!(!large.on_stack());
// consume the miny and get back a value
let original = large.into_inner();
assert_eq!(original, [1; 32]);
for more information, read the docs.
MIT or Apache 2.0