You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(0..5).flat_map(|i| (0..5).map(|j| i + j)).collect::<Vec<_>>()
since i is Copy. But rustc complains with
error: `i` does not live long enough
I could use move, but in the real code it would take ownership of too much. Shouldn't variables be copied if necessary and what's a succinct workaround?