diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-12 13:46:34 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-12 17:49:22 +0200 |
| commit | 56968bc0d65600124774aec74348151cfbc7ea6e (patch) | |
| tree | f8d17499a14936396fc4c9e74d2349329b4486cb /src/geom | |
| parent | 1101a8370f33bf31e4d9840ab8d932b8449267e8 (diff) | |
Merge text runs during paragraph layout
Diffstat (limited to 'src/geom')
| -rw-r--r-- | src/geom/fraction.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/geom/fraction.rs b/src/geom/fraction.rs index f7188603..a913c0c2 100644 --- a/src/geom/fraction.rs +++ b/src/geom/fraction.rs @@ -111,3 +111,9 @@ assign_impl!(Fraction += Fraction); assign_impl!(Fraction -= Fraction); assign_impl!(Fraction *= f64); assign_impl!(Fraction /= f64); + +impl Sum for Fraction { + fn sum<I: Iterator<Item = Self>>(iter: I) -> Self { + Self(iter.map(|s| s.0).sum()) + } +} |
