From 9473aface183feaf48601c5264c3604f5798169e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 9 Jan 2025 14:00:18 +0100 Subject: [PATCH] Fix memory size of `TextElem` (#5674) --- crates/typst-library/src/text/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/typst-library/src/text/mod.rs b/crates/typst-library/src/text/mod.rs index 25ed009e9..d372c399f 100644 --- a/crates/typst-library/src/text/mod.rs +++ b/crates/typst-library/src/text/mod.rs @@ -555,6 +555,7 @@ pub struct TextElem { /// #lorem(10) /// ``` #[fold] + #[ghost] pub costs: Costs, /// Whether to apply kerning. @@ -1431,3 +1432,13 @@ fn check_font_list(engine: &mut Engine, list: &Spanned) { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_text_elem_size() { + assert_eq!(std::mem::size_of::(), std::mem::size_of::()); + } +}