How do I create an empty mutable two dimensional array in Rust?
This is what I have tried so far:
let mut state[[u8 * 4] * 4];
This produces the error
error: expected one of `:`, `;`, `=`, or `@`, found `[`
--> src/main.rs:2:18
|
2 | let mut state[[u8 * 4] * 4];
| ^ expected one of `:`, `;`, `=`, or `@` here
Do you want the contents of the array to be mutable or the variable that holds it? If you want mutable contents, does this work for you?
If you want the variable to be mutable but not the contents, try this:
Does this help? I didn’t actually compile this, so the syntax might be slightly off.