diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:53:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:53:55 +0100 |
| commit | 64f6bb6aa11fb296bb4a411facaeb9518f43a696 (patch) | |
| tree | 1c4a68132aa1b63a73369fdc9893dc1190b67ff2 | |
| parent | b49a8ffd505e05a2f24cf69c868215f72a833230 (diff) | |
Fix paragraph spacing in Rust 1.82+0.11
| -rw-r--r-- | crates/typst/src/layout/inline/mod.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/typst/src/layout/inline/mod.rs b/crates/typst/src/layout/inline/mod.rs index 4fe831e2..9d4745a1 100644 --- a/crates/typst/src/layout/inline/mod.rs +++ b/crates/typst/src/layout/inline/mod.rs @@ -397,12 +397,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. |
