Created
December 14, 2014 22:27
-
-
Save Earlz/2e013bc180c78661123e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use std::io::File; | |
use std::os; | |
use std::str; | |
fn main() { | |
println!("meh"); | |
let filename=&os::args()[1]; | |
let contents: String = match File::open(&Path::new(filename)).read_to_end() { | |
Ok(s) => str::from_utf8(s.as_slice()).expect("this shouldn't happen").to_string(), | |
Err(e) => "".to_string() | |
}; | |
println!("ugh {}", contents.to_string()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment