is there any way to pass an Iterator into another function during a loop, as in: // iter: &mut impl Iterator for _ in iter { // ... some_fn(iter); // ... }
They almost are. For loops are equivalent to let mut unnamable_variable = iter.into_iter(); // this took ownership of iter while let Some(_) = unnamable_variable.next() { ... }
-
-
oooooh of course I forgot the into_iter() part
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.