Fix the Input
The code below is supposed to read a name and print Hi, {name}!, but it has some bugs. Can you fix them?
Hints:
- Make sure the string variable is mutable.
- Don't forget to trim the input!
- Check that
read_lineis called correctly.
rust
use std::io;
fn main() {
let input = String::new();
io::stdin().read_line(&input).unwrap();
println!("Hi, {}!", input);
}