This commit is contained in:
Simon Sapin 2017-06-18 13:21:04 +02:00
parent 7af5a7fd54
commit 316cd35767
34 changed files with 261 additions and 264 deletions

View file

@ -11,10 +11,10 @@ use std::io::{self, Read};
use std::path::{self, PathBuf};
fn read_file(path: &path::Path) -> io::Result<Vec<u8>> {
let mut file = try!(File::open(path));
let mut file = File::open(path)?;
let mut buffer = Vec::new();
try!(file.read_to_end(&mut buffer));
file.read_to_end(&mut buffer)?;
Ok(buffer)
}