I have this function in Rust:
fn printboard(board: Vec<u32>) {
println!("| |{:>2$} {:>2$} {:>2$} {:>2$} {:>2$} {:>2$}| |",
board[1], board[2], board[3], board[4], board[5], board[6]);
}
For some reason, the code throws an error at board[3], saying 'expected usize, found u32.' This does not happen with any of the other board[x] expressions. Any idea why this is happening?
Here is the full error:
error[E0308]: mismatched types
--> src/lib.rs:3:29
|
3 | board[1], board[2], board[3], board[4], board[5], board[6]);
| ^^^^^^^^ expected `usize`, found `u32`
|
= note: expected reference `&usize`
found reference `&u32`
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)