Advertisement
Guest User

Untitled

a guest
May 5th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. const THING: [u8; 4] = [0x61, 0x62, 0x63, 0x64];
  2.  
  3. // replace ^^^ with a bytestring
  4. // const THING: [u8; 4] = b"abcd"[..4];
  5.  
  6. fn main() {
  7. // NO COPYING ALLOWED HERE PLZTKS
  8. i_need_a_four_byte_array(THING)
  9. }
  10.  
  11. // CAN'T CHANGE THIS
  12. fn i_need_a_four_byte_array(thing: [u8; 4]) {
  13. println!("{:?}", thing);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement