diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:53:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:56:31 +0100 |
| commit | 6929b4f9c188fdb4506969d7f454c4af7aea2654 (patch) | |
| tree | 2476553882cb7166b287c96b1bee978d99c6b91c | |
| parent | 70ca0d257bb4ba927f63260e20443f244e0bb58c (diff) | |
Fix paragraph spacing in Rust 1.82+0.10
| -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 6fcdd56d..876ed234 100644 --- a/crates/typst/src/layout/inline/mod.rs +++ b/crates/typst/src/layout/inline/mod.rs @@ -376,12 +376,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. |
