Created
January 12, 2015 16:02
-
-
Save Inari-Whitebear/c5ee50db3f29fad8139d 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
fn get_file_contents(path: &str) -> IoResult<String> { | |
let p = Path::new(BASE_PATH.to_string() + path); | |
let file = try!(File::open_mode(&p, Open, Read)); | |
let read_u8 = try!(file.read_to_end()); | |
let read = try!(std::str::from_utf8(&*read_u8)); | |
Ok(read.to_string()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment