summaryrefslogtreecommitdiff
path: root/src/geom/length.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-17 12:11:00 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-17 12:11:00 +0200
commitdb820ae9aa095cf47d4ae3a582467b01613c3711 (patch)
tree93712ec28190dd754a89e7a9266c9855f2a0bd2c /src/geom/length.rs
parent4494b443bb34fed2208ee3fc87e9a18e7d14b2ab (diff)
Repeat function
Diffstat (limited to 'src/geom/length.rs')
-rw-r--r--src/geom/length.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/geom/length.rs b/src/geom/length.rs
index 838d33c0..96888764 100644
--- a/src/geom/length.rs
+++ b/src/geom/length.rs
@@ -193,6 +193,14 @@ assign_impl!(Length -= Length);
assign_impl!(Length *= f64);
assign_impl!(Length /= f64);
+impl Rem for Length {
+ type Output = Self;
+
+ fn rem(self, other: Self) -> Self::Output {
+ Self(self.0 % other.0)
+ }
+}
+
impl Sum for Length {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
Self(iter.map(|s| s.0).sum())