After deadline commit

This commit is contained in:
Thomas Forgione
2018-04-10 13:37:08 +02:00
parent e508e01359
commit 5cc6196523
4 changed files with 33 additions and 20 deletions
+5
View File
@@ -175,6 +175,9 @@ pub trait Parser {
self.priv_parse_into_model(model, path)
}
/// Parses a file and adds its content to an already existing model.
///
/// This is the method you should implement for you format parser.
fn priv_parse_into_model(&mut self, model: &mut Model, path: &str) -> Result<(), ParserError>;
}
@@ -205,6 +208,8 @@ impl<LP: LineParser> Parser for LP {
use std::io::BufRead;
for (num, line) in file.lines().enumerate() {
let num = num + 1;
if line.is_err() {
return Err(ParserError::OtherError(path.to_owned()));
}