summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-01-05 21:32:48 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-01-05 21:32:48 +0200
commit3c217197966e61b469f78534ee41d838f3304c02 (patch)
tree8e9289c321b3174be3350568da84cbb17c4b086b /src/main.rs
parent5c473e577023f426af158f59424a0edec1afd6fc (diff)
Better error handling in qif file
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e39f589..d5e8ced 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,6 +16,7 @@ use std::path::PathBuf;
use std::result::Result;
use std::fs::File;
+use std::error::Error;
fn parse_filepath(str: &OsStr) -> Result<PathBuf, OsString> {
let path: PathBuf = ::std::convert::From::from(str);
@@ -49,7 +50,8 @@ fn main() -> Result<(), Box<Error>> {
for line_result in lines {
let line = line_result?;
if line == String::from("^") {
- qif_file.push(QifEntry::new(&next_entry));
+ let new_qif_entry = QifEntry::new(&next_entry)?;
+ qif_file.push(new_qif_entry);
next_entry.clear();
} else {
next_entry.push(line);