Hands-on Rust: variable used before declaration (page 22)

The instruction:
Add the following code to your main function, immediately after the println!:

Makes your_name be used before the declaration:
let mut your_name = String::new();

Great book, enjoying it a lot so far! :slight_smile:

2 Likes