const generic expr based fixed length array manipulation crate
Diffstat (limited to 'src/pervasive.rs')
| -rw-r--r-- | src/pervasive.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pervasive.rs b/src/pervasive.rs index afe5846..26aa907 100644 --- a/src/pervasive.rs +++ b/src/pervasive.rs @@ -11,7 +11,7 @@ pub mod scalar_and_array { impl<T: core::ops::$op<Output = T> + Copy, const N: usize> $n<T, N> for T { fn $f(self, rhs: [T; N]) -> [T; N] { - rhs.map(|x| core::ops::$op::$f(x, self)) + rhs.map(|x| core::ops::$op::$f(self, x)) } } }; @@ -118,4 +118,5 @@ pub mod prelude { fn x() { use prelude::*; assert_eq!(2.mul([5, 2].add(5)), [20, 14]); + assert_eq!(5.0.sub([2., 6.]), [3., -1.]); } |