How can I get user input without receiving an “Unsed Variable” warning?
问题 I'm taking a look at Rust and decided to build a small program that takes a user's input and prints it, but also want to do some math stuff with it for practice. Currently, this is how I am taking user input: let mut number = String::new(); let input = io::stdin().read_line(&mut number) .ok() .expect("Failed to read line"); println!("You entered {}", number); However, although I do get the correct input this way, Cargo gives me the following warning: src/main.rs:10:9: 10:14 warning: unused