diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-09 10:21:11 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-09 10:21:11 +0100 |
| commit | cd089b6194c57b2e8dff70efaa7cbd53035f7327 (patch) | |
| tree | f5466a0e2f8633aa609276c0c2794911c7e9252a /src/model/styles.rs | |
| parent | 495b525694aa5901385f3acad043b4a9f3ebb911 (diff) | |
Align set rule
Diffstat (limited to 'src/model/styles.rs')
| -rw-r--r-- | src/model/styles.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs index 37596b8d..b2c328fa 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -913,6 +913,14 @@ where } } +impl Fold for Axes<Option<GenAlign>> { + type Output = Axes<GenAlign>; + + fn fold(self, outer: Self::Output) -> Self::Output { + self.zip(outer).map(|(inner, outer)| inner.unwrap_or(outer)) + } +} + impl<T> Fold for Sides<T> where T: Fold, @@ -920,7 +928,7 @@ where type Output = Sides<T::Output>; fn fold(self, outer: Self::Output) -> Self::Output { - self.zip(outer, |inner, outer| inner.fold(outer)) + self.zip(outer).map(|(inner, outer)| inner.fold(outer)) } } @@ -928,7 +936,7 @@ impl Fold for Sides<Option<Rel<Abs>>> { type Output = Sides<Rel<Abs>>; fn fold(self, outer: Self::Output) -> Self::Output { - self.zip(outer, |inner, outer| inner.unwrap_or(outer)) + self.zip(outer).map(|(inner, outer)| inner.unwrap_or(outer)) } } @@ -936,7 +944,7 @@ impl Fold for Sides<Option<Smart<Rel<Length>>>> { type Output = Sides<Smart<Rel<Length>>>; fn fold(self, outer: Self::Output) -> Self::Output { - self.zip(outer, |inner, outer| inner.unwrap_or(outer)) + self.zip(outer).map(|(inner, outer)| inner.unwrap_or(outer)) } } @@ -947,7 +955,7 @@ where type Output = Corners<T::Output>; fn fold(self, outer: Self::Output) -> Self::Output { - self.zip(outer, |inner, outer| inner.fold(outer)) + self.zip(outer).map(|(inner, outer)| inner.fold(outer)) } } @@ -955,7 +963,7 @@ impl Fold for Corners<Option<Rel<Abs>>> { type Output = Corners<Rel<Abs>>; fn fold(self, outer: Self::Output) -> Self::Output { - self.zip(outer, |inner, outer| inner.unwrap_or(outer)) + self.zip(outer).map(|(inner, outer)| inner.unwrap_or(outer)) } } |
