Skip to content

Commit

Permalink
use result of read_to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schulte committed Oct 21, 2015
1 parent 3e40766 commit 1a2faa4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ pub fn from_file<P: AsRef<Path>>(path: P) -> Result<LsbRelease, Error> {

let mut file_content = String::new();

handle.read_to_string(&mut file_content);
let release = parse(file_content);
Ok(release)
match handle.read_to_string(&mut file_content) {
Ok(_) => {
let release = parse(file_content);
Ok(release)
},
Err(err) => {
Err(err)
}
}
}

pub fn parse(file: String) -> LsbRelease {
Expand Down

0 comments on commit 1a2faa4

Please sign in to comment.