src/sets/cube.rs

changeset 204
016122e0384b
parent 124
6aa955ad8122
--- a/src/sets/cube.rs	Mon Aug 03 19:26:21 2026 -0500
+++ b/src/sets/cube.rs	Tue Aug 04 14:53:58 2026 -0500
@@ -97,14 +97,14 @@
     /// Maps `f` over the triples $\\{(i, a\_i, b\_i)\\}\_{i=1}^N$
     /// of the cube $∏_{i=1}^N [a_i, b_i)$.
     #[inline]
-    pub fn map_indexed<T>(&self, f: impl Fn(usize, U, U) -> T) -> [T; N] {
+    pub fn map_indexed<T>(&self, mut f: impl FnMut(usize, U, U) -> T) -> [T; N] {
         map1_indexed(self, |i, &[a, b]| f(i, a, b))
     }
 
     /// Maps `f` over the tuples $\\{(a\_i, b\_i)\\}\_{i=1}^N$
     /// of the cube $∏_{i=1}^N [a_i, b_i)$.
     #[inline]
-    pub fn map<T>(&self, f: impl Fn(U, U) -> T) -> [T; N] {
+    pub fn map<T>(&self, mut f: impl FnMut(U, U) -> T) -> [T; N] {
         map1(self, |&[a, b]| f(a, b))
     }
 
@@ -145,10 +145,7 @@
     /// $∏_{i=1}^N [a_i, b_i)$.
     #[inline]
     pub fn iter_corners(&self) -> CubeCornersIter<'_, U, N> {
-        CubeCornersIter {
-            index: 0,
-            cube: self,
-        }
+        CubeCornersIter { index: 0, cube: self }
     }
 
     /// Returns the width-`N`-tuple $(b_1-a_1, … ,b_N-a_N)$ of the cube $∏_{i=1}^N [a_i, b_i)$.

mercurial