# thin-slice An owned slice that packs the slice storage into a single word when possible. ## Usage ```rust extern crate thin_slice; use std::mem; use thin_slice::ThinBoxedSlice; struct Ticket { numbers: Box<[u8]>, winning: bool, } struct ThinTicket { numbers: ThinBoxedSlice, winning: bool, } fn main() { let nums = vec![4, 8, 15, 16, 23, 42].into_boxed_slice(); let ticket = ThinTicket { numbers: nums.into(), winning: false, }; println!("Numbers: {:?}", ticket.numbers); println!("size_of::(): {}", mem::size_of::()); println!("size_of::(): {}", mem::size_of::()); println!("size_of::(): {}", mem::size_of::()); } ``` Output on `x86_64`: ``` Numbers: [4, 8, 15, 16, 23, 42] size_of::(): 8 size_of::(): 24 size_of::(): 16 ``` ## License thin-slice is distributed under the terms of the [Mozilla Public License, v. 2.0](https://www.mozilla.org/MPL/2.0/).