I just started learning Rust, and I'm currently trying to create a simple rock paper scissors game. I decided to create a main menu to choose between singleplayer and multiplayer as this
io::stdin()
.read_line(&mut choix)
.expect("Failed to read line");
choix = str::to_lowercase(&choix);
match choix.as_str() {
"singleplayer" => singleplayer(),
"multiplayer" => multiplayer(),
_ => println!("Unknown choice, please choose 'singleplayer' or 'multiplayer'"),
}
println!("End of game");
but the pattern matching does not seem to work properly, as shown by this execution: singleplayer execution what am I doing wrong? Thanks!