I'm trying to match the user input, but it always returns this error:
What am I doing wrong?
fn main(){
let board: [[i32; 3]; 3] = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
println!("{:?}", board);
println!("Who will start, X or O?");
let mut to_start = String::new();
io::stdin().read_line(&mut to_start).expect("An error was encountered");
match to_start {
"X" => println!("Player 1 starts"),
"O" => println!("Player 2 starts"),
_ => println!("Please enter a valid input"),
};
}