diff --git a/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs index 0ae11e3d41..e722a4900c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs @@ -9,7 +9,7 @@ fn main() { println!("Guess the number!"); // ANCHOR: ch07-04 - let secret_number = rand::thread_rng().gen_range(1..=100); + let secret_number = rand::rng().random_range(1..=100); // updated code without deprecated error // ANCHOR_END: ch07-04 println!("The secret number is: {secret_number}");