mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix paragraph spacing in Rust 1.82+
This commit is contained in:
parent
70ca0d257b
commit
6929b4f9c1
@ -376,12 +376,18 @@ impl<'a> Line<'a> {
|
|||||||
|
|
||||||
/// How much can the line stretch
|
/// How much can the line stretch
|
||||||
fn stretchability(&self) -> Abs {
|
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
|
/// How much can the line shrink
|
||||||
fn shrinkability(&self) -> Abs {
|
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.
|
/// The sum of fractions in the line.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user