diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:53:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:54:15 +0100 |
| commit | 5d338e901e8106dacf6d45365741938e1cf173a9 (patch) | |
| tree | 9233568ecce05d520296fbd9490037a2bf3ac790 /crates | |
| parent | 74373526386b5ff9afa269f0701c64d7873a4647 (diff) | |
Fix paragraph spacing in Rust 1.82+0.11.1-with-extras
Diffstat (limited to 'crates')
| -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. |
