Implement the new fields for radio link.

This commit is contained in:
Tom Alexander
2023-12-11 14:10:27 -05:00
parent 4753f4c7c6
commit 68dccd54b1
2 changed files with 13 additions and 3 deletions

View File

@@ -128,6 +128,7 @@ pub struct RadioTarget<'s> {
pub struct RadioLink<'s> {
pub source: &'s str,
pub path: &'s str,
pub post_blank: Option<&'s str>,
pub children: Vec<Object<'s>>,
}
@@ -671,11 +672,15 @@ impl<'s> StandardProperties<'s> for RadioLink<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
Some(self.path)
}
fn get_post_blank(&self) -> PostBlank {
todo!()
self.post_blank
.map(|post_blank| post_blank.chars().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}