xxxxxxxxxx
// Must use trim, there is something invisible, I haven't search for it yet
match name.trim() {
"Alice" => println!("Your name is Alice"),
"Bob" => println!("Your name is Bob"),
_ => println!("Invalid name: {}", name),
}
xxxxxxxxxx
//Declare dependencies
use std::io::stdin;
fn main() {
//Declare a mutable input string
let mut input_string = String::new();
stdin().read_line(&mut input_string)
.ok()
.expect("Failed to read line");
}