Implement the new fields for regular link.
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-11 12:19:49 -05:00
parent 0108f5b0b1
commit b943f90766
2 changed files with 16 additions and 5 deletions

View File

@@ -110,6 +110,8 @@ pub struct RegularLink<'s> {
/// This does not take into account the post-processing that you would get from the upstream emacs org-mode AST. Use `get_search_option` for an equivalent value.
pub search_option: Option<Cow<'s, str>>,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
pub children: Vec<Object<'s>>,
pub application: Option<Cow<'s, str>>,
}
@@ -645,11 +647,15 @@ impl<'s> StandardProperties<'s> for RegularLink<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
self.contents
}
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.")
}
}