pub fn indexed_map<T, U, F: Fn(usize, &T) -> U>( v: &[T], f: F, ) -> Vec<(usize, U)>
Map over a slice and collect the results, also returning the original indices.