2 ms·
The usual safe way is to do that, and count on LLVM to eliminate the copy. However, Rust also has a MaybeUninit wrapper type for allocating uninitialized memory
by pornel 4y ago
The usual safe way is to do that, and count on LLVM to eliminate the copy. However, Rust also has a MaybeUninit wrapper type for allocating uninitialized memory wherever you want and writing to it directly.