[RESOLVE] Issue with rand


(sorry for my bad english ;P)
I just started rust this morning.

I don’t find the probleme. If i can copy/paste the code in book, i have the same error.

here the code

The compiling error is :

src\main.rs:11:25: 11:41 error: unresolved name `rand::thread_rng`
src\main.rs:11     let nombre_secret = rand::thread_rng().gen_range(1, 100);


You are missing extern crate rand; at the top.


Uups! Just missing to paste it :stuck_out_tongue:



Did you add the rand crate as a dependency in your Cargo.toml file? https://doc.rust-lang.org/book/guessing-game.html#generating-a-secret-number



Thank’s <3