summaryrefslogtreecommitdiff
path: root/crates/typst-layout/src/math/lr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-layout/src/math/lr.rs')
-rw-r--r--crates/typst-layout/src/math/lr.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/typst-layout/src/math/lr.rs b/crates/typst-layout/src/math/lr.rs
index 2f4556fe..19176ee8 100644
--- a/crates/typst-layout/src/math/lr.rs
+++ b/crates/typst-layout/src/math/lr.rs
@@ -13,17 +13,16 @@ pub fn layout_lr(
ctx: &mut MathContext,
styles: StyleChain,
) -> SourceResult<()> {
- let mut body = elem.body();
-
// Extract from an EquationElem.
+ let mut body = &elem.body;
if let Some(equation) = body.to_packed::<EquationElem>() {
- body = equation.body();
+ body = &equation.body;
}
// Extract implicit LrElem.
if let Some(lr) = body.to_packed::<LrElem>() {
if lr.size(styles).is_one() {
- body = lr.body();
+ body = &lr.body;
}
}
@@ -100,7 +99,7 @@ pub fn layout_mid(
ctx: &mut MathContext,
styles: StyleChain,
) -> SourceResult<()> {
- let mut fragments = ctx.layout_into_fragments(elem.body(), styles)?;
+ let mut fragments = ctx.layout_into_fragments(&elem.body, styles)?;
for fragment in &mut fragments {
match fragment {