Implement the new fields for entity.

This commit is contained in:
Tom Alexander
2023-12-11 12:44:42 -05:00
parent 9cfb2fa052
commit d556d28f49
2 changed files with 9 additions and 3 deletions

View File

@@ -187,6 +187,7 @@ pub struct Entity<'s> {
// Skipping latin1 because it is detrimental to the future. If anyone out there is using latin1, take a long look in the mirror and change your ways.
pub utf8: &'s str,
pub use_brackets: bool,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -740,11 +741,15 @@ impl<'s> StandardProperties<'s> for Entity<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
None
}
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.")
}
}