Implement the new fields for statistics cookie.

This commit is contained in:
Tom Alexander
2023-12-11 12:51:07 -05:00
parent ab281de3c6
commit 4af0d3141f
2 changed files with 11 additions and 4 deletions

View File

@@ -263,6 +263,7 @@ pub struct Target<'s> {
pub struct StatisticsCookie<'s> {
pub source: &'s str,
pub value: &'s str,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -894,11 +895,15 @@ impl<'s> StandardProperties<'s> for StatisticsCookie<'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.")
}
}