Arrays and for Loops
You can print such an array by asking for its debug representation with :
Rust lets you iterate over things like arrays and ranges using the for
keyword:
Hard-code both functions to operate on 3 × 3 matrices.
Could you use slices instead of hard-coded 3 × 3 matrices for your argument and return types? Something like &[&[i32]]
for a two-dimensional slice-of-slices. Why or why not?
See the ndarray crate for a production quality implementation.