Skip to content

Instantly share code, notes, and snippets.

@Leonidas-from-XIV
Created April 13, 2014 11:05
Show Gist options
  • Select an option

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

Select an option

Save Leonidas-from-XIV/10579302 to your computer and use it in GitHub Desktop.
let mut buffer = [0, .. 8];
let read = match fdInput.read(buffer) {
Ok(num) => num,
Err(e) => fail!("Couldn't read"),
};
println!("read {} bytes", read);
let number = match u64::parse_bytes(buffer, 2) {
Some(n) => n,
None => fail!("Reading number"),
};
println!("parsed {}", number);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment