rust/fpnum/src/lib.rs
changeset 14161 3078123e84ea
parent 14160 37c99587825d
child 14199 a4c17cfaa4c9
--- a/rust/fpnum/src/lib.rs	Mon Nov 05 21:36:28 2018 +0100
+++ b/rust/fpnum/src/lib.rs	Tue Nov 06 00:02:23 2018 +0100
@@ -455,6 +455,17 @@
                           self.y().$name(rhs))
             }
         }
+    };
+    ($($op: tt)::+<$arg: tt>, $name: tt) => {
+        impl $($op)::+<$arg> for FPPoint {
+            type Output = Self;
+
+            #[inline]
+            fn $name(self, rhs: $arg) -> Self {
+                Self::new(self.x().$name(rhs),
+                          self.y().$name(rhs))
+            }
+        }
     }
 }
 
@@ -480,6 +491,7 @@
 right_scalar_bin_op_impl!(ops::Mul, mul);
 right_scalar_bin_op_impl!(ops::Sub, sub);
 right_scalar_bin_op_impl!(ops::Div, div);
+right_scalar_bin_op_impl!(ops::Div<u32>, div);
 left_scalar_bin_op_impl!(ops::Mul, mul);
 
 macro_rules! bin_assign_op_impl {