From f547c97072881069417acd3b79b08fb7ecf40ba2 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 31 Oct 2022 15:47:49 +0100 Subject: Reduce usage of `finalize` --- src/library/math/mod.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/library/math') diff --git a/src/library/math/mod.rs b/src/library/math/mod.rs index b23ed7cf..63d5f419 100644 --- a/src/library/math/mod.rs +++ b/src/library/math/mod.rs @@ -103,16 +103,13 @@ impl Show for MathNode { &self, _: Tracked, styles: StyleChain, - mut realized: Content, + realized: Content, ) -> SourceResult { - let mut map = StyleMap::new(); - map.set_family(styles.get(Self::FAMILY).clone(), styles); - - if self.display() { - realized = realized.spaced(styles.get(Self::ABOVE), styles.get(Self::BELOW)); - } - - Ok(realized.styled_with_map(map)) + Ok(if self.display() { + realized.spaced(styles.get(Self::ABOVE), styles.get(Self::BELOW)) + } else { + realized + }) } } -- cgit v1.2.3