summaryrefslogtreecommitdiff
path: root/src/geom
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-09 10:21:11 +0100
commitcd089b6194c57b2e8dff70efaa7cbd53035f7327 (patch)
treef5466a0e2f8633aa609276c0c2794911c7e9252a /src/geom
parent495b525694aa5901385f3acad043b4a9f3ebb911 (diff)
Align set rule
Diffstat (limited to 'src/geom')
-rw-r--r--src/geom/corners.rs15
-rw-r--r--src/geom/sides.rs15
2 files changed, 12 insertions, 18 deletions
diff --git a/src/geom/corners.rs b/src/geom/corners.rs
index d84160cc..386acbfb 100644
--- a/src/geom/corners.rs
+++ b/src/geom/corners.rs
@@ -45,16 +45,13 @@ impl<T> Corners<T> {
}
}
- /// Zip two instances into an instance.
- pub fn zip<F, V, W>(self, other: Corners<V>, mut f: F) -> Corners<W>
- where
- F: FnMut(T, V) -> W,
- {
+ /// Zip two instances into one.
+ pub fn zip<U>(self, other: Corners<U>) -> Corners<(T, U)> {
Corners {
- top_left: f(self.top_left, other.top_left),
- top_right: f(self.top_right, other.top_right),
- bottom_right: f(self.bottom_right, other.bottom_right),
- bottom_left: f(self.bottom_left, other.bottom_left),
+ top_left: (self.top_left, other.top_left),
+ top_right: (self.top_right, other.top_right),
+ bottom_right: (self.bottom_right, other.bottom_right),
+ bottom_left: (self.bottom_left, other.bottom_left),
}
}
diff --git a/src/geom/sides.rs b/src/geom/sides.rs
index 9b8d9a6b..40327a42 100644
--- a/src/geom/sides.rs
+++ b/src/geom/sides.rs
@@ -45,16 +45,13 @@ impl<T> Sides<T> {
}
}
- /// Zip two instances into an instance.
- pub fn zip<F, V, W>(self, other: Sides<V>, mut f: F) -> Sides<W>
- where
- F: FnMut(T, V) -> W,
- {
+ /// Zip two instances into one.
+ pub fn zip<U>(self, other: Sides<U>) -> Sides<(T, U)> {
Sides {
- left: f(self.left, other.left),
- top: f(self.top, other.top),
- right: f(self.right, other.right),
- bottom: f(self.bottom, other.bottom),
+ left: (self.left, other.left),
+ top: (self.top, other.top),
+ right: (self.right, other.right),
+ bottom: (self.bottom, other.bottom),
}
}