3 ms·
array.map is not inline, it consumes the array and returns another https://doc.rust-lang.org/std/primitive.array.html#method.map https://doc.rust-lang.org/std/p
by nextaccountic 5y ago
array.map is not inline, it consumes the array and returns another https://doc.rust-lang.org/std/primitive.array.html#method.map https://doc.rust-lang.org/std/primitive.array.html#method.ma...
But yes in the end this is all done in the stack
We could have an inline version of map (for arrays and Vec) if we had a way to assert that two types have the same size. This means we can reuse the buffer because all elements will fit.