diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:53:55 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-11-29 16:57:23 +0100 |
| commit | ad0b70b67df19da6dfaae2a4ae89f1a105571f88 (patch) | |
| tree | ca74b04e5423c056491ccc4809f71025f89e1a6c /library/src | |
| parent | 5775644e51b0e3435bb6db0a9f37cb7811576079 (diff) | |
Fix paragraph spacing in Rust 1.82+0.6
Diffstat (limited to 'library/src')
| -rw-r--r-- | library/src/layout/par.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/library/src/layout/par.rs b/library/src/layout/par.rs index 6b914e80..cca38ed3 100644 --- a/library/src/layout/par.rs +++ b/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. |
