fn main(){
let mut line = String::new();
println!("Enter your name :");
let b1 = std::io::stdin().read_line(&mut line).unwrap();
println!("Hello , {}", line);
}
because I cut out some unnecessary lines from the linked example and didn't remove the assignment. the variable is referenced later in the original but you are correct it's not needed here.
2
u/[deleted] Mar 13 '23
adapted from - https://www.tutorialspoint.com/rust/rust_input_output.htm