Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const THING: [u8; 4] = [0x61, 0x62, 0x63, 0x64];
- // replace ^^^ with a bytestring
- // const THING: [u8; 4] = b"abcd"[..4];
- fn main() {
- // NO COPYING ALLOWED HERE PLZTKS
- i_need_a_four_byte_array(THING)
- }
- // CAN'T CHANGE THIS
- fn i_need_a_four_byte_array(thing: [u8; 4]) {
- println!("{:?}", thing);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement