Rust - Unresolved import `rand`



I encounter this error when I’m going to use rand::thread_rng().gen_range() function to create a random number.
How to solve this ? It’s really simple!

  1. open Cargo.toml
  2. add rand = "*" below [dependencies]