Skip to content

Instantly share code, notes, and snippets.

@bjorns
Created May 1, 2014 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjorns/1714a0e9752a2381b25e to your computer and use it in GitHub Desktop.
Save bjorns/1714a0e9752a2381b25e to your computer and use it in GitHub Desktop.
use std::io::{File};
use std::str::from_utf8_owned;
fn main() {
let path = Path::new("foobar.log");
let mut hw_file = File::open(&path).ok().unwrap();
let data = from_utf8_owned(hw_file.read_to_end().ok().unwrap()).unwrap();
println!("{:s}", data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment