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.
View all comments
Show parent comment
29
u/Deep-Piece3181 Mar 12 '23 edited Mar 12 '23
println!(βI donβt even know how to get and store user input in Rust πβ);
(I only watched like the first 10 minutes of the freecodecamp Rust tutorial)