aboutsummaryrefslogtreecommitdiffstats
path: root/src/dsb/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dsb/mod.rs')
-rw-r--r--src/dsb/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dsb/mod.rs b/src/dsb/mod.rs
index 846b017..4ee8521 100644
--- a/src/dsb/mod.rs
+++ b/src/dsb/mod.rs
@@ -3,8 +3,8 @@ use crate::Error;
use html5ever::parse_document;
//use html5ever::rcdom::RcDom;
-use markup5ever_rcdom::RcDom;
use html5ever::tendril::TendrilSink;
+use markup5ever_rcdom::RcDom;
mod html;
@@ -17,6 +17,8 @@ pub struct DSB {
pub year: String,
pub valid_from: chrono::NaiveDate,
pub updated_at: chrono::NaiveDateTime,
+
+ /// Day this entry affects
pub date: chrono::NaiveDate,
pub week: Week,
pub free_lessons: Option<String>,
@@ -34,7 +36,6 @@ impl DSB {
.from_utf8()
.read_from(&mut html.as_bytes())?;
-
html::parse(&dom.document)
}
}
@@ -75,7 +76,8 @@ mod test {
use super::DSB;
#[test]
fn read_dsb() {
- let html = std::fs::read_to_string("./src/dsb/mod.rs").unwrap();
+ let html = std::fs::read_to_string("./src/dsb/dsb.html").unwrap();
+ println!("{}", html);
let dsb = DSB::parse(&html).unwrap();
assert_eq!(dsb.len(), 3);