Converts all try! macros to ? syntax.

Fixes #46
This commit is contained in:
rep-nop
2017-02-25 22:12:33 -05:00
committed by Jakob Stoklund Olesen
parent cf5701b137
commit b23f1fb347
22 changed files with 270 additions and 270 deletions

View File

@@ -6,9 +6,9 @@ use std::io::{Result, Read};
/// Read an entire file into a string.
pub fn read_to_string<P: AsRef<Path>>(path: P) -> Result<String> {
let mut file = try!(File::open(path));
let mut file = File::open(path)?;
let mut buffer = String::new();
try!(file.read_to_string(&mut buffer));
file.read_to_string(&mut buffer)?;
Ok(buffer)
}