Skip to content

Instantly share code, notes, and snippets.

@Leonidas-from-XIV
Created April 14, 2014 20:00
Show Gist options
  • Select an option

  • Save Leonidas-from-XIV/10678479 to your computer and use it in GitHub Desktop.

Select an option

Save Leonidas-from-XIV/10678479 to your computer and use it in GitHub Desktop.
use std::cast;
fn u8tou64(u: &[u8]) -> &[u64] {
let r:&[u64] = unsafe { cast::transmute(u) };
r
}
fn main() {
let s = [1u8, 2u8, 3u8, 4u8];
let v = u8tou64(&s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment