summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-11-29 16:53:55 +0100
committerLaurenz <laurmaedje@gmail.com>2024-11-29 16:57:20 +0100
commitefe3dff387702a842702858994838e6181d2827c (patch)
tree89eb51feb69b2eaca91c80f48163f9f03f9356cf /crates
parentda8367e189b02918a8fe1a98fd3059fd11a82cd9 (diff)
Fix paragraph spacing in Rust 1.82+0.7
Diffstat (limited to 'crates')
-rw-r--r--crates/typst-library/src/layout/par.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/typst-library/src/layout/par.rs b/crates/typst-library/src/layout/par.rs
index 271d9467..b5ece81f 100644
--- a/crates/typst-library/src/layout/par.rs
+++ b/crates/typst-library/src/layout/par.rs
@@ -514,12 +514,18 @@ impl<'a> Line<'a> {
/// How much can the line stretch
fn stretchability(&self) -> Abs {
- self.items().filter_map(Item::text).map(|s| s.stretchability()).sum()
+ self.items()
+ .filter_map(Item::text)
+ .map(|s| s.stretchability())
+ .fold(Abs::zero(), |acc, x| acc + x)
}
/// How much can the line shrink
fn shrinkability(&self) -> Abs {
- self.items().filter_map(Item::text).map(|s| s.shrinkability()).sum()
+ self.items()
+ .filter_map(Item::text)
+ .map(|s| s.shrinkability())
+ .fold(Abs::zero(), |acc, x| acc + x)
}
/// The sum of fractions in the line.