|
|
|
@ -16,8 +16,10 @@ With `MaybeUninit`, we can initialize an array element-for-element as follows:
|
|
|
|
|
```rust
|
|
|
|
|
use std::mem::{self, MaybeUninit};
|
|
|
|
|
|
|
|
|
|
// Size of the array is hard-coded but easy to change. This means we can't
|
|
|
|
|
// use [a, b, c] syntax to initialize the array, though!
|
|
|
|
|
// Size of the array is hard-coded but easy to change (meaning, changing just
|
|
|
|
|
// the constant is sufficient). This means we can't use [a, b, c] syntax to
|
|
|
|
|
// initialize the array, though, as we would have to keep that in sync
|
|
|
|
|
// with `SIZE`!
|
|
|
|
|
const SIZE: usize = 10;
|
|
|
|
|
|
|
|
|
|
let x = {
|
|
|
|
|