aboutsummaryrefslogtreecommitdiff
path: root/src/deck.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/deck.rs')
-rw-r--r--src/deck.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/deck.rs b/src/deck.rs
index d23529f..0c302e1 100644
--- a/src/deck.rs
+++ b/src/deck.rs
@@ -1,4 +1,4 @@
-use crate::{model::entry::Entry, util::serialization};
+use crate::{model::Line, util::serialization};
use anyhow::{Error, Result};
use std::fmt;
use std::fs::File;
@@ -23,10 +23,10 @@ impl std::error::Error for ParseError {
}
}
-pub fn read(deck: &str) -> Result<Vec<Entry>> {
+pub fn read(deck: &str) -> Result<Vec<Line>> {
let file = File::open(deck)?;
let reader = BufReader::new(file);
- let mut entries: Vec<Entry> = Vec::new();
+ let mut entries: Vec<Line> = Vec::new();
for (index, line) in reader.lines().enumerate() {
let line = line?;
@@ -57,9 +57,9 @@ pub fn read(deck: &str) -> Result<Vec<Entry>> {
.to_string(),
}));
} else {
- entries.push(Entry {
- part_1: serialization::line_to_words(&t1.to_string()),
- part_2: serialization::line_to_words(&t2.to_string()),
+ entries.push(Line {
+ part_1: serialization::line_to_words(t1),
+ part_2: serialization::line_to_words(t2),
})
}
}