Implement the new fields for drawer.
Some checks failed
clippy Build clippy has failed
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has failed

This commit is contained in:
Tom Alexander
2023-12-15 10:59:40 -05:00
parent d6232dc49c
commit 28f12a04f7
2 changed files with 45 additions and 22 deletions

View File

@@ -95,6 +95,8 @@ pub struct Drawer<'s> {
pub affiliated_keywords: AffiliatedKeywords<'s>,
pub drawer_name: &'s str,
pub children: Vec<Element<'s>>,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -238,11 +240,15 @@ impl<'s> StandardProperties<'s> for Drawer<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
self.contents
}
fn get_post_blank(&self) -> PostBlank {
todo!()
self.post_blank
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}