After deadline commit
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user